I am trying to create a subsite programmatically on a document
library event. The site i have the document library on is:
http://server/sites/TestSite.
I want to create a subsite at: http://server/sites/TestSite/subSite.
Here's my code (vb.NET), it's not working. Am I doing something wrong
code-wise, or do I need to pass credentials? I am a domain admin
where I am running this, so I think I should be alright. Thanks, Chris
Dim siteURL As String = "TestSite/subSite"
Dim siteTitle As String = "subSite"
Dim siteDesc As String = "this is a test"
Dim nLCID As System.UInt32
nLCID = Convert.ToUInt32(1033)
Dim site As New SPSite("http://server/sites/TestSite")
Dim webcoll As SPWebCollection = site.AllWebs
Dim newweb As SPWeb = webcoll.Add(siteURL, siteTitle, siteDesc,
nLCID, SPWebTemplate.WebTemplateSTS, False, False)
Do you know someone who can help? Share a link to this thread on twitter, or facebook.