Export (0) Print
Expand All

SPList.GetContentTypeIdByUrl Method

Returns the content type identifier (ID) for the content type with the specified URL.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

public SPContentTypeId GetContentTypeIdByUrl(
	string url
)

Parameters

url
Type: System.String

The URL for the content type.

Return Value

Type: Microsoft.SharePoint.SPContentTypeId
The content type ID.

If url is null or an empty string, this method returns RootOfList().

Show:
© 2014 Microsoft