Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. SPSite siteCollection = SPContext.Current.Site;
  2. SPWeb mySite = SPContext.Current.Web;
  3. SPListTemplateCollection listTemplates = //get a reference to my template here - this is not in the site collection, but in my project;
  4. SPListTemplate listTemplate = listTemplates["Custom List Template"];
  5.  
  6. mySite.Lists.Add("Custom List", "A list created from a custom list template in my project", listTemplate);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement