Getting the content type in event handler

Itemadding Event

SPContentType = properties.ListItem.ContentType;

Itemadded Event

SPList listName = properties.listName;
string contentTypeName = properties.AfterProperties["ContentType"].ToString();
SPContentType contentType = list.ContentTypes[contentTypeName];

Related Post

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.