1

I added a new ItemUpdated Event Receiver inside my enterprise wiki site collection inside sharepoint server 2013. and i defined the following:-

  1. event reciever will get fired when and item was updated.
  2. it should fire on "Wiki Pages library".
  3. here is the generated element.xml file:-
  <Receivers ListTemplateId="119">
      <Receiver>
        <Name>EventReceiver1ItemUpdated</Name>
        <Type>ItemUpdated</Type>
        <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
        <Class>UpdateWikiPageTitleandTerm.EventReceiver1.EventReceiver1</Class>
        <SequenceNumber>10000</SequenceNumber>
      </Receiver>
  </Receivers>
</Elements>
  1. the scope of the event receiver is "Web".

now when i edit a wiki page the event receiver will fire correctly, but also if i upload a new image inside the images library and then i edit the images properties the event receiver will get fired, also when i upload a new document inside the document library and then i edit it properties the event receiver will get fire... so not sure why the event receiver is not only firing on "Wiki Pages libraries" ?

  • 1
    Not sure why you get that behaviour, have you tried with ListUrl="SitePages" instead of ListTemplateId? – Robert Lindgren Mar 21 '17 at 12:27
  • 1
    Try with specific list instead of ListTemplateID. Eg <Receivers ListUrl="Lists/Sample"> – Arun Mar 21 '17 at 12:31
  • @RobertLindgren you know using listurl will not extend well if i am going to use the same event receiver on multiple libraries and multiple sites... – john Gu Mar 21 '17 at 16:16
  • @Arun listtempleteid is the most extensible option as i can use the same event receiver on multiple sites and lists... – john Gu Mar 21 '17 at 16:16
  • @RobertLindgren can you advice further on this?? what could be causing this problem ? and is it happening at your end also ? – john Gu Mar 29 '17 at 0:24

Your Answer

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

Browse other questions tagged or ask your own question.