Share via


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

Syntax

'Declaration
Public Function GetContentTypeIdByUrl ( _
    url As String _
) As SPContentTypeId
'Usage
Dim instance As SPList
Dim url As String
Dim returnValue As SPContentTypeId

returnValue = instance.GetContentTypeIdByUrl(url)
public SPContentTypeId GetContentTypeIdByUrl(
    string url
)

Parameters

Return Value

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

Remarks

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

See Also

Reference

SPList Class

SPList Members

Microsoft.SharePoint Namespace