MsProject技术交流群207637602

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();

}

  

posted @ 2013-07-08 01:19  鳄鱼的眼泪  阅读(296)  评论(0编辑  收藏  举报

专业MSProject,QQ411033149