Wednesday, September 2, 2009

SPWeb.AvailableContentTypes vs SPWeb.ContentTypes

SPWeb.ContentTypes
- Gets the collection of content types for the Web site.

-The ContentTypes property returns only the content types that exist on the current Web site, 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 Web sites. When you add a content type to this collection, you make it available to lists in the current Web site and in any child Web sites.

SPWeb.AvailableContentTypes
-Gets the collection of all content types that apply to the current scope, including those of the current Web site, as well as any parent Web sites.

-You can apply any content type that is returned in this collection to lists in the current Web site. However, you cannot add content types to the collection that is returned in this property. It is a read-only property. If you want to make a new content type available, you must add it to the collection that is returned by the ContentTypes property. That collection includes only the content types that exist in the current Web site.

1 comments:

Anonymous,  May 19, 2013 at 9:24 PM  

Thank you!!