Attaching an event handler to a list in SharePoint 2007
Code:
SPWeb web = properties.Feature.Parent as SPWeb;
SPList list = web.Lists["[List Name]"];
String assemblyName = "[Assembly Name],Version=[Version],Culture=neutral,PublicKeyToken=[PublicKeyToken]";
String className = "EventReceiverClassName";
list.EventReceivers.Add(SPEventReceiverType.ItemUpdated, assemblyName, className);
list.Update();
Another option , you can use event handler class functions from SPCORE
ReplyDeletehttp://spcore.codeplex.com/
:-)