Share via


SPLimitedWebPartCollection.Item property (Guid)

Gets the first WebPart in the collection with the specified storage key.

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

Syntax

'Declaration
Public ReadOnly Default Property Item ( _
    storageKey As Guid _
) As WebPart
    Get
'Usage
Dim instance As SPLimitedWebPartCollection
Dim storageKey As Guid
Dim value As WebPart

value = instance(storageKey)
public WebPart this[
    Guid storageKey
] { get; }

Parameters

  • storageKey
    Type: System.Guid

    A GUID representing the Web Part location in the collection.

Property value

Type: System.Web.UI.WebControls.WebParts.WebPart
A Web Part object at the specified location.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The collection does not contain a WebPart with the specified storageKey.

See also

Reference

SPLimitedWebPartCollection class

SPLimitedWebPartCollection members

Item overload

Microsoft.SharePoint.WebPartPages namespace