Share via


SPWebCollection.Delete method

Deletes the website with the specified website-relative URL from the collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub Delete ( _
    strWebUrl As String _
)
'Usage
Dim instance As SPWebCollection
Dim strWebUrl As String

instance.Delete(strWebUrl)
public void Delete(
    string strWebUrl
)

Parameters

  • strWebUrl
    Type: System.String

    A string that contains the website URL relative to the root website in the site collection. For example, if the website to delete is located at http://MyServer/sites/MySiteCollection/DeleteSubsite, specify DeleteSubsite, or if it is located at http://MyServer/sites/MySiteCollection/Subsite/DeleteSubsite, specify Subsite/DeleteSubsite.

Remarks

This method deletes the website specified by the strWebUrl parameter from the web collection.

See also

Reference

SPWebCollection class

SPWebCollection members

Microsoft.SharePoint namespace