Loading...

Thursday, June 2, 2011

How to Attach the EventReceiver to Particular List



1)Create  EventReceiver  ,Make sure that  Its  Feature  Scope  is Web Scoped,   Otherwise event will fire on all the Lists.

2)Make sure that ,Event receiver feature is deployed in the scope where List Exists.

3)In Element.xml , In receiver tag, modify the ListTemplateID to ListUrl="List/ListName"
Make sure that the path for ListUrl is correct, It is different for document libraries,Announcements and other list types
If its not correct then you will get Nativehr error


4)If still eventreceiver dont get  fired then Check SharePointProjectItem.spdata
In ProjectItem tag , check for Supported scope .It should be web only

4)Write the solutionValidator   to Validate above things before deploying the Event Receiver.

No comments: