When you register Event handlers get added to
all the lists of that template. for eg: Lets take a common scenario. Lets say
you will have at least 2 custom lists in your site List1, List2. Now you write
an event handler that you want to trigger on operations on one list List1. But
this event handler also gets attached to List2 without you intending for.
Solution:
There are may solutions you may find for this. One and most straight
forward is write a feature stapler. But again writing a stapler is not easy and
takes a lot of time. Also it's one more feature added to your site.
The second solution(not too obvious) also exists. Now if you are writing
a feature you got to have a Elements.xml file(At least I have to have one).
Here making some tweaks will solve your problem.
I have created a solution called
GG.BlogsEventHandler. I have written Asynchronous receiver. Below is how my
Elements.xml looks like.
Look carefully at line #4. Do you see any
difference? By default you will have
No comments:
Post a Comment