SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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 Event Receiver for document library. It is added in Elements.xml like this:

  <Receivers ListTemplateId="101">

I would like to use this ER for all my document libraries. Do I have to put <Receivers> element for each of those lists, or is there easier way?

share|improve this question

The <Receivers ListTemplateId="101"> specifies that the following receivers are for all lists created using the ListTemplate with Type=101, which is all the once created as pure "Document Libraries", but not "Asset Libraries", "Form Libraries", ... Custom List Templates.

If you need to cover all these then you need to either:

  • specify the entire list of theses (new <Receivers> element with all the children.
  • write an event receiver for ListAdded which checks for the type of list and then adds the receivers in code if BaseType is "1" and in a FeatureReciever for your feature loop through and add them to all existing lists with BaseType="1"
share|improve this answer

You can use a feature to bind the event receiver to all lists\libraries with a particular template ID

Please check the section New Event Registration technique using the <Receivers/> tag on this post :

share|improve this answer

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.