WebPart.StorageKey property

Gets the unique identifier that is set by the Web Part infrastructure when a Web Part is added to a Web Part Zone.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
<WebPartStorageAttribute(Storage.None)> _
Public ReadOnly Property StorageKey As Guid
    Get
'Usage
Dim instance As WebPart
Dim value As Guid

value = instance.StorageKey
[BrowsableAttribute(false)]
[WebPartStorageAttribute(Storage.None)]
public Guid StorageKey { get; }

Property value

Type: System.Guid
For a Web Part that is added to a WebPartZone control, the Web Part infrastructure sets a System.Guid value. For a Web Part that is outside of a WebPartZone control (properties are not saved in the WebParts table of the Microsoft SharePoint Foundation database), the value is set to Guid.Empty.

Remarks

The StorageKey property cannot be modified because it is the unique identifier that the Web Part infrastructusre uses to read and write the properties for the Web Part.

See also

Reference

WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace