Monday, July 26, 2010

Creating Site programatically using sitetemplate(.stp file)

SPSite oSiteCollection = new SPSite(“http://servername/SiteDirectory”);
//(SPSite oSiteCollection = new SPSite("http://jagadeeshv:9999"))
SPWeb oWebSite = oSiteCollection.OpenWeb();
SPWebCollection oSitesCollection = oWebSite.Webs;
SPWeb newWebSite = oSitesCollection.Add("abc", "siteTemplate", "This is site created through code.", 1033, "Createsitestp.stp", true, false);

No comments:

Post a Comment

Content Editor Webpart not showing up in SharePoint Online ------------------------------------------------------------------------------...