1] Create content type “CMRContentType”
2] Add Content Type to list “CMR”.
3] Create Application page in your solution
4] Past below code in feature active
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
//SPWeb
web = properties.Feature.Parent as SPWeb;
SPSite site = properties.Feature.Parent as SPSite;
SPWeb web = site.OpenWeb();
string url = web.Url;
web.AllowUnsafeUpdates = true;
SPList list = web.Lists["CMR"];
SPContentType ct = list.ContentTypes["CMRContentType"];
ct.EditFormUrl = "_layouts/15/BFL.CMR/CMRForm.aspx"; // Path of
application page
ct.NewFormUrl = "_layouts/15/BFL.CMR/4MForm.aspx";
//
ct.NewFormUrl = "_layouts/15/BFL.CMR/4MForm.aspx";
//ct.DisplayFormUrl
= "_layouts/dispform.aspx";
ct.Update();
list.Update();
web.AllowUnsafeUpdates = false;
}

No comments:
Post a Comment