none
Open custom application page on list edit item RRS feed

  • Question

  • I have one list & a custom application page, when i click on Edit Item in the List Item Context Menu, i want to open my Custom application page in Popup.

    Also, it should pass the Item ID as query string to the application page.

    How can we achieve this?

     


    Thanks, Kunal Govani
    Friday, November 18, 2011 6:36 AM

Answers

  • Hi,

    Use the given code to change default editform for list

    SPWeb web = SPContext.Current.Web;
     
    web.AllowUnsafeUpdates = true;
     
    SPList list = web.Lists["My List"];
     
    SPContentType ct = list.ContentTypes["Item"];
     
    ct.EditFormUrl = "_layouts/editform.aspx";
    ct.NewFormUrl = "_layouts/newform.aspx";
    ct.DisplayFormUrl = "_layouts/dispform.aspx";
     
    ct.Update();
    list.Update();web.AllowUnsafeUpdates = false;
    
    

     

    to  pass ItemID as querystring pass itemid={ItemId} in the Edit form URL after ?.

    i.e. "_layouts/editform.aspx?itemid={ItemID}";


    Thanks.... ________________ Baba (MCTS, MCPD)
    • Marked as answer by Kunal Govani Monday, November 21, 2011 5:43 AM
    Friday, November 18, 2011 7:00 AM

All replies