This topic has not yet been rated Rate this topic

SPContentType Constructor (SPContentTypeId, SPContentTypeCollection, String)

SharePoint 2010

Initializes a new instance of the SPContentType class using the specified SPContentTypeId structure.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
public SPContentType(
	SPContentTypeId contentTypeId,
	SPContentTypeCollection contentTypes,
	string name
)

Parameters

contentTypeId
Type: Microsoft.SharePoint.SPContentTypeId
The content type ID for the new content type.
A value for the Parent property is determined by examining the content type ID passed in this parameter.
contentTypes
Type: Microsoft.SharePoint.SPContentTypeCollection
The collection to add the new content type to.
name
Type: System.String
The name for the new content type. This value is set as the value of the Name property.
Exception Condition
SPException

The collection passed in the contentTypes argument cannot be modified.

-or-

The parent content type cannot be found.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ