Share via


PublishingWebCollection.Add Method (String)

Creates a child PublishingWeb object in the parent PublishingWeb object of this collection.

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

Syntax

'Declaration
Public Function Add ( _
    newPublishingWebUrl As String _
) As PublishingWeb
'Usage
Dim instance As PublishingWebCollection
Dim newPublishingWebUrl As String
Dim returnValue As PublishingWeb

returnValue = instance.Add(newPublishingWebUrl)
public PublishingWeb Add(
    string newPublishingWebUrl
)

Parameters

  • newPublishingWebUrl
    Type: System.String
    Name property for the PublishingWeb object to be created. This parameter maps directly to the syntax for the [T:Microsoft.SharePoint.SPWebCollection.Add(System.String)] object. The URL should not have a leading slash. The URL string should be site-relative.

Return Value

Type: Microsoft.SharePoint.Publishing.PublishingWeb
A child PublishingWeb object in the parent PublishingWeb object of this collection.

Exceptions

Exception Condition
[System.ArgumentNullException]

The newPublishingWebUrl parameter must not be a null reference (Nothing in Visual Basic) or empty.

Remarks

The new PublishingWeb inherits the language ID from the parent. Call the alternate Add method to provide a language ID explicitly. The Publishing Site Web template is always used for this Add method.

See Also

Reference

PublishingWebCollection Class

PublishingWebCollection Members

Add Overload

Microsoft.SharePoint.Publishing Namespace