Reputation: 4443
I have default sharepoint web site. In events reciever of Pages library i can access my current web:
var web=properties.Web;
And i got very strange problem. web.ContentTypes collection is emtpy. I cannot get and access any content type there! When via website i see all content types for current web.
Why this ContentTypes collection is empty?
Upvotes: 2
Views: 894
Reputation: 867
Try web.AvailableContentTypes.
It contains all content types that can be used on the site, rather than just the ones defined on this particular site.
See:
Upvotes: 2