3
有沒有一種方法可以輕鬆複製SharePoint列表代碼?複製SharePoint列表
有沒有一種方法可以輕鬆複製SharePoint列表代碼?複製SharePoint列表
從SharePoint標籤判斷,我假設您打算問「如何以編程方式複製SharePoint列表(SPList)?」
沒有測試它(甚至試圖編譯),我會做這樣的事情:
SPWeb web; /* add code to initialize to current web */
SPList sourceList = web.Lists["nameOfSourceList"];
sourceList.SaveAsTemplate("templateFNM.stp", "tempList", "tempListDescription",
true /* include list content */);
SPListTemplate template = web.ListTemplates["tempList"];
web.Lists.Add("newListName", "newListDescription", template);
web.Update();
SPList newList = web.Lists["newListName"];
此外,here's到博客文章的鏈接,獲得相同的翻過的Web應用程序。
最後建議一句話:如果您使用「編程方式」而不是「明智的代碼」,您將獲得更好的搜索結果。
希望這會有所幫助。