Posted by stratosg in Sharepoint, Tutorials
on Jan 5th, 2010 | 0 comments
To cut to the chase, the process of creating a new subsite using WSS is as follows:
- Connect to the main site using SPSite.
- Add the new site using the Add() method on AllWebs collection.
- Do all kinds of magic using the newly created site.
Here is a small C# code example:
-
SPSite rootSite = new SPSite("http://testsite");
-
SPWeb site = rootSite.AllWebs.Add("testsub");
In order to access this site you need to visit “http://testsite/testsub”. Hope this helps!