Tuesday, December 9, 2008

Event Handlers and Event Receiver’s in MOSS

Tere are two types of Events Synchronous and Asynchronous Events.* Synchronous events can trap an item, document library or site before it is deleted,added or updated.eg, ItemAdding, ItemUpdating,ItemDeleting etc.* Asynchronous events can trap an item, document library or site when it is added,deleted or updated.eg, ItemAdded, ItemUpdated,ItemDeleted etc. We create Event Recivers to handle these events. An event receiver basically, is a piece of managed code that is launched in response to an event that takes place within SharePoint.SharePoint Object Model exposes several event classes inherited from Microsoft.SharePoint assembly. There are three main event classes:
  • SPItemEventReceiver
  • SPListEventReceiver
  • SPWebEventReceiver
Each class includes both synchronous and asynchronous methods to work with Item, List or Web Level.