I have a List Template DocLibTemplate
with FeatureId : {00BFEA71-E717-4E80-AA17-D0C71B360101}
. I am trying to have a event receiver subscribe to all libraries of this type. This is the code I have for the Elements.xml
file for the event receiver.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="101">
<Receiver>
<Name>EventReceiver1ItemAdded</Name>
<Type>ItemAdded</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>SharePointProject7.EventReceiver1.EventReceiver1</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
From my undesrtanding specifying that ListTemplateId="101"
means the event handler will subscribe to Document Libraries. Is there a way to have it subscribe to only Document Libraries that use the DocLibTemplate
either through the TemplateID of the template or the FeatureID, or can I create a new ContentType and have the list subscribe to that?
Edit : I found the xml file for the list template by downloading the list template stp file and unarchiving that. This had the manifest.xml file which contains the information.