O'Reilly logo

Microsoft SharePoint 2010 Development Cookbook by Ed Musters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

List Event Receivers

A List Event Receiver, simply put is code that you (the developer) can choose to "attach" to one or more lists and that code will (generally) run when either you add, delete, or update items on a list.

List Item Event Receivers are important as they provide you the opportunity to provide some custom error handling or validation logic, and even cancel/prevent the add/update/delete from taking place. The functionality is provided by inheriting from the SPItemEventReceiver class and overriding one of the following key methods :

  • ItemAdded
  • ItemAdding
  • ItemDeleted
  • ItemDeleting
  • ItemUpdated
  • ItemUpdating

You will note from this list the term used - "Before" and "After" events. The before events end in "ing", are trapped before the, say update, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required