Before Properties,After Properties and ListItem in Sharepoint 2010 Event Recievers

Event recievers are common in Sharepoint development so its better to understand the data available in each events. Sometimes as a developer we jump into coding before thinking about contextual data availability.One more imprtant thing to notice list event reciever  and document libraray event reciever are different interms of contextual data avaialability.Following Table will give you a clear picture about the contextual data in each events.

Sharepoint List

Event

BeforeProperties

AfterProperties

ListItem

ItemAdding

Null

New  Value

Null

ItemAdded

Null

New Value

New Value

ItemUpdating

Null

Changed Value

Original Value

ItemUpdated

Null

Changed Value

Changed Value

ItemDeleting

Null

Null

Original Value

ItemDeleted

Null

Null

Null




Sharepoint Document Libraray

Event

BeforeProperties

AfterProperties

ListItem

ItemAdding

Null

Null

Null

ItemAdded

Null

Null

New Value

ItemUpdating

Original Value

Changed Value

Original Value

ItemUpdated

Original Value

Changed Value

Changed Value

ItemDeleting

Null

Null

Original Value

ItemDeleted

Null

Null

Null