locked
List Event Receiver - Subsite/Site collection RRS feed

  • Question

  • Hi,

    I have a List event receiver that is attached to a custom list.

    my Elements.xml file

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Receivers ListUrl="Lists/Application List">
          <Receiver>
            <Name>ApplicationListEventReceiverItemAdding</Name>
            <Type>ItemAdding</Type>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>ApplicationListEventReceiver.ApplicationListEventReceiver.ApplicationListEventReceiver</Class>
            <SequenceNumber>10000</SequenceNumber>
          </Receiver>
          <Receiver>
            <Name>ApplicationListEventReceiverItemUpdating</Name>
            <Type>ItemUpdating</Type>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>ApplicationListEventReceiver.ApplicationListEventReceiver.ApplicationListEventReceiver</Class>
            <SequenceNumber>10000</SequenceNumber>
          </Receiver>
    
      </Receivers>
    </Elements>

    However, it's a list that is not in the root site. How to define the subsite?

    It's working fine in my environment machine, but I was wondering for the deployment...

    The Scope is set to Web


    • Edited by okdreamy Wednesday, May 15, 2013 10:26 AM
    Wednesday, May 15, 2013 9:54 AM

Answers

  • Hi,

    Keep the scope of your feature to "Web" and not "Site".

    The "Site" scope is for site collection level features, the "Web" scope is for individual sub-sites (also referred to as 'webs').

    Change the scope to web and activate it in the site features, not site collection features, and you should get it working.

    Hope this helps.

    ----------

    Regards

    Ankur

    Wednesday, May 15, 2013 10:40 AM