Use of SPListCollection.Add Method (String, String, String, String, Int32, String, SPListTemplate.QuickLaunchOptions) in sharepoint
How to use of
SPListCollection.Add(String, String, String, String, Int32, String, SPListTemplate.QuickLaunchOptions)`
method for creating SharePoint document 开发者_高级运维library programmatically using asp.net?
Adding a document library that appears on the Quick Launch area
Hard way - using the Add(String, String, String, String, Int32, String, String, SPFeatureDefinition, SPListTemplate.QuickLaunchOptions) method overload
web.Lists.Add("Old documents",
"This library stores old documents.",
"old-docs",
"00BFEA71-E717-4E80-AA17-D0C71B360101",
101,
"101",
SPListTemplate.QuickLaunchOptions.On);
- the
featureId
parameter (4th one) is a string that contains the ID of the feature that defines the list; you can find feature IDs of standard list definitions online (here, here or here) or in appropriate files in the 12 hive
Easy way - in 2 steps
Guid newListGuid = web.Lists.Add("Old documents",
"This library stores old documents.",
SPListTemplateType.DocumentLibrary);
SPList newList = web.Lists[newListGuid];
newList.OnQuickLaunch = true;
newList.Update();
精彩评论