10

http://msdn.microsoft.com/en-us/library/ms453149.aspx says

To create the event handler 1. Start Microsoft Visual Studio 2010. 2. On the File menu, point to New, and then click Project. 3. In Project Types, under Visual Basic or C#, select Event Receiver. ...

So wait, is there a difference between an event receiver and an event handler? Or is it just that what is commonly referred to as an event handler in most environments is for some reason called an event receiver in SharePoint?

For example in this link - http://blog.sharedove.com/adisjugo/index.php/2009/03/12/develop-and-deploy-a-sharepoint-event-receiver-from-the-scratch/ - the author uses "event handler" throughout, except when referencing the SharePoint class names. Googling for "event receiver" turns up mostly SharePoint references, with a few Microsoft Office hits here and there.

If anyone has the definitive word on this, I'd appreciate it.

1
  • 1
    Documentation refers to "event handlers" but code uses "event receivers". We have more tags using the "event handlers" term here, therefore I've made "event receiver" a synonym of event-handlers on this site.
    – Alex Angas
    Commented Sep 1, 2011 at 22:36

3 Answers 3

8

Both mean the same; handle the Event or receive the event.

8

Going back to WSS2/SP2003 it was Event Handler. With WSS3/SP2007 it changed to Event Receiver...there is even a setting on the Web App in CA that let's you enable/disable support for backwards-compatible event handling.

In the context of 2010, "event handler" or "event receiver" is one in the same.

4

An Event Receiver is managed code that responds to SharePoint Foundation events whenever specific triggering actions occur - which is same as Event Handler.

The term "Event Receiver" is specific to context of SharePoint where as "Event handler" is a general term used for any subroutine that handles inputs received in a program. Event handlers are a central concept in event-driven programming.

4
  • 1
    In addition to this, Event Handlers are usually asynchronous delegated blocks of code, whereas SharePoint Event Receivers can be asynchronous or synchronous.
    – James Love
    Commented Nov 27, 2011 at 19:29
  • Event handlers are usually synchronous, no?
    – Paul Lucas
    Commented Nov 27, 2011 at 22:20
  • 1
    An 'Event handler' in context of SharePoint is named as 'Event Receiver'-both are same. Event Handler\Receiver can be asynchronous or synchronous. Commented Nov 28, 2011 at 6:20
  • Imagine you have a PDF file on your desktop, It can be represented by a 'File' object.When you upload the same file to a document library in SharePoint, It becomes 'SPFile'. Still that file remains a file!...only attached contextual information differs.Same applies to 'Event Receiver' and 'Event handler' Commented Nov 28, 2011 at 6:33

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.