Wednesday, November 3, 2010

How to Create the Event Handlers

Here is a nice article about how to create Event Handlers.

The event handlers can be attached to Site, List or Contenttype. The advantage with the content type is this that every time you create the instance, the events are automatically activated with new spawn.

Three ways to create Event Handlers.
1. Create it by Code i.e SPEventReceiver
(use Lutz Roders Reflection app for extracting class names)
(3 parameters: SPEventReceiverType, AssemblyName, ClassName)
(Sequence Number: use sequence number after 10,000. SP uses after 1000)
2. Create it by Feature. (wsp file. needs to be activated at every spawn)
3. Through Custom Site Setting - (Developed by : Brian Wilson)
(You can add, delete, edit events on site, list and content type level)

For more Details, visit Brian Wilson - Event Handlers

No comments: