Partager via


WebPart.ID Property

Gets or sets an identifier for the Web Part.

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

Syntax

<WebPartStorageAttribute(Storage := Storage.Shared)> _
<BrowsableAttribute(False)> _
Public Overrides Property ID As String
    Get
    Set

Dim instance As WebPart
Dim value As String

value = instance.ID

instance.ID = value
[WebPartStorageAttribute(Storage = Storage.Shared)]
[BrowsableAttribute(false)]
public override string ID { get; set; }

Property Value

Type: System.String
A string value that returns the identifier for the Web Part.

Remarks

The ID property will be written out by ASP.NET as the __WebPartId attribute on the tag for the Web Part.

Note

Do not set this property when a Web Part is contained in a WebPartZone control; the Web Part infrastructure automatically sets this value.

See Also

Reference

WebPart Class

WebPart Members

Microsoft.SharePoint.WebPartPages Namespace