1. create a directory structure in visual studio as follows
Featues / "<"featuesname">" / feature.xml
Add schema to feature.xml from loc -">" web server xtn\12\template\xml\wss12.xsd
"<"feature ID=”” Title=”” Description= “” Scope = “” Hidden=”false”
"<"feature id="””" title="””" description="“”" scope="“”" hidden="”false”"">" "<"!-Note users cant activate or deactivate the feature only admin can-">"
"<"elementmanifests">"
"<"elementmanifest location="”Elements.xml”"">"
"<"elementmanifests">""<"elementmanifest location="”Elements.xml”"">"
2. Add new file Elements.xml
"<"elements">""<"elements">"
"<"module name="””" path="”url”"">"
"<"file url="””" type="”Ghostable”"">"
3. Inherit from SPFeatureReceiver class
Override the events FeatureInstalled, FeatureActivated,
Featureuninstalled, Featuredeactivated, Featureuninstalling, Featuredeactivating
4. put the DLL in GAC
5. In feature.xml ad these tags
"<"Feature ID=””
ReceiverClass=
ReciverAssembly=
Wednesday, April 23, 2008
Steps for Creating Item Event Handlers
- Open VS 2005 -> Select a class Library project -> Name it ____Handlers.
- Inherit the class from SPItemEventReceiver.
- override ItemAdded, ItemUpdated (Asynchronous Events)
Item Adding, ItemUpdating (Synchronous Events) - Install the DLL in GAC
- There are Two ways to register an Event Handler a. Install Features b. Through code
- To Register through code -> Open new console project
Open site -> web -> get the list through code use the following method to register - List.EventReceivers.Add(
, , );
Subscribe to:
Posts (Atom)