SPWebPartManager.GetStorageKey Method
Returns the storage key for the specified Web Part on the page.
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Function GetStorageKey ( _
webPart As WebPart _
) As Guid
'Usage
Dim instance As SPWebPartManager
Dim webPart As WebPart
Dim returnValue As Guid
returnValue = instance.GetStorageKey(webPart)
public Guid GetStorageKey(
WebPart webPart
)
Parameters
webPart
Type: System.Web.UI.WebControls.WebParts.WebPartThe Web Part for which the storage key is retrieved.
Return Value
Type: System.Guid
The storage key for this Web Part.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The Web Part is a null reference (Nothing in Visual Basic). |
WebPartPageUserException | The Web Part is not on the page that contains this SPWebPartManager. |