Skip to main content

Cloud

SPWeb.AvailableContentTypes – READ ONLY PROPERTY!

Maybe you have wondered what is the difference between the SPWeb.AvailableContentTypes and SPWeb.ContentType, I know I did. Reading intellisence, I couldn’t really tell which one to use, they both seem close to being identical:

I decided to work with SPWeb.AvailableContentTypes but ran into problems when trying to update my content as I was continually getting the "The collection cannot be modified" error.

Turns out that the SPWeb.AvailableContentTypes is a read-only property. Now reading the Remarks section on msdn, you can see that they mention it is a read-only property but I really wished this kind of information would be included in intellisence.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Thomas DuPont

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram