Compartilhar via


SPWebPartManager.CopyWebPart Method

Returns the WebPart passed in without creating a copy.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Protected Overrides Function CopyWebPart ( _
    webPart As WebPart _
) As WebPart
'Usage
Dim webPart As WebPart
Dim returnValue As WebPart

returnValue = Me.CopyWebPart(webPart)
protected override WebPart CopyWebPart(
    WebPart webPart
)

Parameters

Return Value

Type: System.Web.UI.WebControls.WebParts.WebPart
A Web Part to be added to a page.

Remarks

This override returns the webPart passed into the procedure without creating a copy.

See Also

Reference

SPWebPartManager Class

SPWebPartManager Members

Microsoft.SharePoint.WebPartPages Namespace