SPWeb.ContentTypes Property

Gets the collection of content types for the website.

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

Syntax

'Declaration
<ClientCallableAttribute> _
<ClientCallableConstraintAttribute(Type := ClientCallableConstraintType.NotNull)> _
Public ReadOnly Property ContentTypes As SPContentTypeCollection
    Get
'Usage
Dim instance As SPWeb
Dim value As SPContentTypeCollection

value = instance.ContentTypes
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.NotNull)]
public SPContentTypeCollection ContentTypes { get; }

Property Value

Type: Microsoft.SharePoint.SPContentTypeCollection
An SPContentTypeCollection object that represents the content types.

Remarks

The ContentTypes property only returns the types that exist on the current website, not all content types in the current scope. Use the AvailableContentTypes property to return all content types in the current scope, including those of any parent websites.

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace