View Single Post
  #2 (permalink)  
Old June 17th, 2008, 11:43 AM
millerthegorilla millerthegorilla is offline
Registered User
 
Join Date: Jun 2008
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Somebody answered this question on another forum. It works like this:
            SPSite currentSite = new SPSite(currentUrl);
            SPWeb currentWeb = currentSite.OpenWeb();
            SPUser currentUser = currentWeb.CurrentUser;

            currentWeb.AllowUnsafeUpdates = true;
            currentWeb.Update();
            SPWebCollection subsites = currentWeb.Webs;

            string url = newUrlText.Text;

           try
           {
               subsites.Add(url,
                            newSiteTitleText.Text,
                            siteDescriptionText.Text,
                            (uint)(1033),
                            siteTemplateList.SelectedItem.Value,
                            true,
                            false);
....
           finally
           {
               currentWeb.AllowUnsafeUpdates = false;
               currentWeb.Update();
Reply With Quote