Share via


PublishingWeb.GetPublishingWeb method

Retrieves an instance of the PublishingWeb that wraps the specified Web object.

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

Syntax

'Declaration
Public Shared Function GetPublishingWeb ( _
    context As ClientRuntimeContext, _
    web As Web _
) As PublishingWeb
'Usage
Dim context As ClientRuntimeContext
Dim web As Web
Dim returnValue As PublishingWeb

returnValue = PublishingWeb.GetPublishingWeb(context, _
    web)
public static PublishingWeb GetPublishingWeb(
    ClientRuntimeContext context,
    Web web
)

Parameters

Return value

Type: Microsoft.SharePoint.Client.Publishing.PublishingWeb
A PublishingWeb instance that wraps the specified Web class.

Remarks

The web parameter must not be a null reference (Nothing in Visual Basic).

Use this method in order to access PublishingWeb behavior for an instance of a Web class that has already been retrieved. You can also retrieve instances of the PublishingWeb class through the GetPublishingWebs method.

Before you use this method, check the IsPublishingWeb method to confirm that publishing behavior is supported on this instance of the Web class. If publishing is not supported on the Web class, then the methods and properties of the PublishingWeb wrapper may behave unexpectedly.

It is up to the caller of this method to close the instance of the Web class that was passed in by calling the SPWeb.Close method. Calling the PublishingWeb.Close method has no effect.

See also

Reference

PublishingWeb class

PublishingWeb members

Microsoft.SharePoint.Client.Publishing namespace