0

I want to create an event receiver that I'll attach it to content types across 4 site collections. The content type is being made programmatically, so no XML definition.

Also, I want to create an event receiver that I'll attach it to multiple lists across 4 site collections.

Are these possible?The problem I ran is that I need to "hook" it to a list, so which list?

1 Answer 1

0

You can create your content type, attach an event receiver to it, you don't need to create the event receiver by adding a new item in Visual Studio. Instead you add a class file write your event receiver from scratch inherting from SPItemEventReceiver, then add your content type to your lists. That way, the content type (with the event receiver) will be reusable on all lists it's added to.

Refer to this article for more info:

http://sharepoint-magic.blogspot.com/2013/06/content-type-event-receiver.html

And this one:

https://karinebosch.wordpress.com/walkthroughs/event-receivers-walkthrough3/

1
  • So, if I want to change the code of the event receiver, I just copy the dll to GAC?
    – XristosK
    Commented Mar 8, 2015 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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