2

I created a new event receiver and hooked it onto the Pages library for my publishing site. I attached each one of the events exposed, but I cannot get any of them to fire.

elements xml:

  <Receivers ListTemplateId="850">
      <Receiver>
        <Name>PagesActivityItemAdding</Name>
        <Type>ItemAdding</Type>
        <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
        <Class>University.Activity.PagesActivity.PagesActivity</Class>
        <SequenceNumber>10000</SequenceNumber>
      </Receiver>
      .....
  </Receivers>

The template id is infact 850, I tried to verify this, and got 850 on all my searches.

This is for a publishing site.

Is the template id incorrect, and what would the correct template id be?

I'm trying to hit break-points just to see if it fires but as stated they just don't.

  • Have you tried using ListURL instead of ListTemplateId? – NotVonKaiser Jun 10 '13 at 16:29
  • Hi John, I did, but I need this to attach to every single Pages library in my site collection, so a particular list url will not work in this instance, unless I create one for each of my +2500 sub-sites. – JadedEric Jun 10 '13 at 17:13
  • 1
    Actually, you only need to note the relative URL, not the absolute URL there, so unless for some reason your site library isn't in the /Pages folder on each subsite (and since this is a built-in thing, they should be placed there by default), this should still continue to deploy properly. – NotVonKaiser Jun 10 '13 at 18:44
  • John, that's actually not a bad idea, don't know why I didn't see it :D. Always a good idea asking experts. – JadedEric Jun 11 '13 at 7:02
1

I know this is an old question, If I changed the ListTemplateId to 101 (document library) it would catch, and fire. Changing it back to '850' however, would not work on the pages library.

Try deploying the feature using the scope as 'Site'. When creating the receiver VS2010 automatically defined the scope as 'Web'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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