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
Assembly: Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
Syntax
'Declaration
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)
public WebPartDefinition GetById(
Guid id
)
Parameters
id
Type: System.GuidThe 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 WebPartDefinition 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