SharePointAds TextOnly

Thursday 27 August 2009

Sharepoint : How to redirect list form URL's?

We can redirect sharepoint's default New/Edit/display forms by our new created custom forms..

SPList list = web.Lists["listName"];
SPContentType ct = list.ContentTypes["Item"];

ct.NewFormUrl = "NewCustomForm.aspx";
ct.EditFormUrl = "NewEditForm.aspx";
ct.DisplayFormUrl = "NewDisplay.aspx";
ct.Update();

newVendorList.Update();


-

2 comments:

  1. Thanks Nitin,
    But I use SharePoint Designer more often. So using it to right click the list >> Change the New/Display/Edit forms link is much easier.

    Thanks for sharing though :-)

    ReplyDelete
  2. Hello Avinash,

    Thanks for your information to redirect URL from Sharepoint Designer! :)

    But somewhere, not every clients uses Sharepoint Designer, so if we want to redirect URL with Visual Studio coding then we can redirect URL using above lines!

    Hope this also helps to others :)

    Regards,
    N i T ! N

    ReplyDelete