< Feature>
< Scope="Web"
Title="Event handler"
Id="Create a GUID"
xmlns="http://schemas.microsoft.com/sharepoint/" >
< ElementManifests >
< ElementManifest location="element.xml" >
< /ElementManifests>
< /Feature>
The element.xml file registers the event handler assembly and associates it with a list type, for announcement list type is 104 as shown below:
< Elements >
< Receivers
< ListTemplateOwners="name of site definition using which this site is created and this list belongs to "
ListTemplateId="104" >
< Receiver >
< Name >EventHandler< /Name >
< Type >2< /Type >
< SequenceNumber >10000< /SequenceNumber >
< Assembly > "NameSpace name of assembly"
,version=1.0.0.0,Culture=neutral,PublicKeyToken="public key token of assembly"
< /Assembly >
< /Class >"ClassNameOfAssembly"< /Class >
< Data >< /Data >
< Filter >< /Filter >
< /Receiver >
< /Receivers >
< /Elements >
Once we are done with feature creation ,register feature using stsadm.exe tool present in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
Run the following command to install feature :
stsadm -o installfeature -filename EventFeature\feature.xml
Run the follwing command to activate the feature:
stsadm -o activatefeature -filename EventFeature\feature.xml -url "url of the site"
That's it you are done with features ...just go forward and try adding ,deleting,editing in list and check weather it performs as per your expectations .
ENJOY!!! LIFE IS MUCH SIMPLER NOW :-)
Saturday, January 06, 2007
Registering Event Handler for list events
To register event handler for list events , create folder in the \template\features folder named "EventFeature" which contain a feature.xml file that specifies the scope and ID of the "feature" and element .xml file that the former file references.The feature file might look like the following :
Subscribe to:
Post Comments (Atom)
Gray Failures: What is it and how to detect one?
If you are reading this article , i guess you are curious to know about gray failures and different methods to detect gray failures. Hopefu...
-
Note : In below scenario jenkins was deployed in Linux container Scenario: Jenkins build failed with error. java.io.IOException: error...
-
Ever wanted to have a people picker kind of control in Infopath form and that too in browser mode. Did i heard yes :) , well there is a Acti...
-
Simple concept but still pain in head if unable to figure out :) Response.Redirect("#");
1 comment:
We found out the hard way that when an anonymous user interacts with a list (i.e. adds an item), the event handlers are not fired. This is a bug in SharePoint 2007 (acknowledged by MS) that will "not be fixed any time soon". So, for Internet facing sites where an anonymous user completes a form that inserts a new entry in a list, the ItemAdded() event will not fire.
Post a Comment