Compartir a través de


WebPartDefinitionCollection.GetById Method

Returns the Web Part definition object in the collection with a Web Part identifier equal to the id parameter.

Namespace:  Microsoft.SharePoint.Client.WebParts
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Function GetById ( _
    id As Guid _
) As WebPartDefinition
'Usage
Dim instance As WebPartDefinitionCollection
Dim id As Guid
Dim returnValue As WebPartDefinition

returnValue = instance.GetById(id)
[RemoteAttribute]
public WebPartDefinition GetById(
    Guid id
)

Parameters

  • id
    Type: System.Guid

    The Web Part identifier of the Web Part definition to retrieve.

Return Value

Type: Microsoft.SharePoint.Client.WebParts.WebPartDefinition
Returns a WebPartDefinition instance representing the Web Part definition object in the collection with a Web Part identifier equal to the id parameter.

Exceptions

Exception Condition
[System.ArgumentOutOfRangeException]

There is no Web Part definition object in the collection with a Web Part identifier equal to the id parameter. Error code: -2146233086.

Remarks

All WebPartDefinition objects must have a unique value for their Id property.

See Also

Reference

WebPartDefinitionCollection Class

WebPartDefinitionCollection Members

Microsoft.SharePoint.Client.WebParts Namespace