ContentTypeCollection.GetById method

Returns the content type with the specified ID from the collection.

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

Syntax

'Declaration
Public Function GetById ( _
    contentTypeId As String _
) As ContentType
'Usage
Dim instance As ContentTypeCollection
Dim contentTypeId As String
Dim returnValue As ContentType

returnValue = instance.GetById(contentTypeId)
public ContentType GetById(
    string contentTypeId
)

Parameters

  • contentTypeId
    Type: System.String

    A string that contains the content type ID. It must not be a null reference (Nothing in Visual Basic). It must conform to the following ABNF: nonzero-digit = "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"digit = "0" / nonzero-digitnonzero-hexdigit = nonzero-digit / "A" / "B" / "C" / "D" / "E" / "F"hexdigit = "0" / nonzero-hexdigitid = *(nonzero-hexdigit hexdigit / "0" nonzero-hexdigit)parentids = *(16(hexdigit hexdigit))contentTypeId = id [ "00" parentids].

Return value

Type: Microsoft.SharePoint.Client.ContentType
A ContentType object that represents the content type.

Remarks

If a content type with the given identifier is not found in the collection, the server must return a null reference (Nothing in Visual Basic).

See also

Reference

ContentTypeCollection class

ContentTypeCollection members

Microsoft.SharePoint.Client namespace