2

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?

Ievgen
  • 4,261
  • 7
  • 75
  • 124

1 Answers1

2

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:

SPWeb.ContentTypes on MSDN

ErikE
  • 857
  • 8
  • 18