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();
<XmlDocuments> <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url"> <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url"> <New>_layouts/NewQuote.aspx</New> <Edit>_layouts/EditQuote.aspx</Edit> <Display>_layouts/ViewQuote.aspx</Display> </FormUrls> </XmlDocument> </XmlDocuments>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)