Share via


WebPartGalleryItemBase.InstantiateFromXml Method (String)

Instantiates a WebPart with a string that contains the XML.

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

Syntax

'Declaration
Protected Function InstantiateFromXml ( _
    webPartXml As String _
) As WebPart
'Usage
Dim webPartXml As String
Dim returnValue As WebPart

returnValue = Me.InstantiateFromXml(webPartXml)
protected WebPart InstantiateFromXml(
    string webPartXml
)

Parameters

  • webPartXml
    Type: System.String

    A string that contains the Web Part XML.

Return Value

Type: System.Web.UI.WebControls.WebParts.WebPart
The instantiated Web Part.

Remarks

This method instantiates and returns a WebPart by using the specified Web Part XML string.

See Also

Reference

WebPartGalleryItemBase Class

WebPartGalleryItemBase Members

InstantiateFromXml Overload

Microsoft.SharePoint.WebPartPages Namespace