Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Add method of the SPWebCollection class creates a Web site object with the specified site-relative URL.
strWebUrl A string that contains the site-relative URL.
A Microsoft.SharePoint.SPWeb object that represents the Web site.
The following code example creates a site within the current site collection.
This example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint and Microsoft.SharePoint.WebControls namespaces.
Platforms: Microsoft Windows Server 2003
Security: Code Access Security