Add(String) Method

The Add method of the SPWebCollection class creates a Web site object with the specified site-relative URL.

Parameters

strWebUrl   A string that contains the site-relative URL.

Return Value

A Microsoft.SharePoint.SPWeb object that represents the Web site.

Example

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.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security