SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an ItemAdding event handler created and targeted to a Custom List. The event receiver seems to be firing on all custom list on the site. I wonder if I should target it to a specific custom list. Is this possible? or should I just leave it like it is now? If it's possible, how?

share|improve this question
up vote 5 down vote accepted

Navigate to corresponding Elements.xml, and you will notice Receivers element with ListTemplateId attribute, like this:

<Receivers ListTemplateId="100">

What you need is to use ListUrl attribute instead, and point it to the specific list using provided url.

There is a how-to on this on MSDN:

Basic example:

<Receivers ListUrl="Lists/Test">

Full schema of Receivers element could be found in Receivers Element MSDN reference article.

Also, the binding could be performed programmatically (usually in FeatureActivated receiver), using SPList.EventReceivers collection.

share|improve this answer
ListUrl works only if feature has Scope=”Web”. In case the feature has Scope=”Site”, event receiver is fired for every list, ListUrl is ignored. – Amit Kumawat Jan 3 '12 at 17:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.