Wednesday, April 20, 2011

Sharepoint Event Recievers

Event Handlers
Event Handlers can be applied to List,Document Libraries and Content Types inside a Sharepoint Site.Event Handlers can be applied for different operations on a list item such as adding,updating and deleting the list item.

Synchronise and Asynchronous Events
The events ending with -ing(ItemAdding,ItemUpdating,ItemDeleting) are termed as Synchronised Events. In this senario the Event Handlers defined for the events are exected before the operation takes place on the Content Database.

 Asynchronous Events are the ones that end with -ed(ItemAdded,ItemUpdated,ItemDeleted).The Event Handlers for this events are executed after the operation occurs in the content database.

Base Classes
While developing event handlers there are several base classes from which you can inherit.

SPItemEventReciever: One must inherit from this base class if  you want the event handler to be executed when the item is added,updated and deleted.

SPListEventReciever: One must inherit from this base class when you want the event handler to execute when the structure of the list is modifed or the content type added or removed from the list.

SPFeatureEventReciever: Inherit this base class if you want your event handler to execute when the feature events such as installation,unstallation,activation and deactivation are executed.

SPWebEventReciever: You can Inherit this base class if you want your event handlers to execute when site is added or  removed from the site collection.

SPEmailEventReciever:Inherit this base class for creating a event handler for emails that are send to a Sharepoint list.



1 comment:

  1. Original article can be found at http://karinebosch.wordpress.com/walkthroughs/event-receivers-theory/

    ReplyDelete