how to create a custom form for sharepoint list
在VS中创建一个applicationPage映射到Layouts文件夹下,然后代码如下:
SPList lstTest = web.Lists["Shared Documents"];
string newUrl = string.Format("layouts/NewEditForm.aspx", web.ServerRelativeUrl, lstTest.RootFolder.Url);
var form = web.GetFile(newUrl);
if (form != null && form.Exists)
{
//string newFomrUrl = lstTest.DefaultEditFormUrl.Replace("EditForm.aspx", "docEditForm.aspx");
lstTest.DefaultEditFormUrl = newUrl;
lstTest.Update();
}

浙公网安备 33010602011771号