Latest Posts

What is Event Receiver?

Definition: Event Receiver enables us to apply custom code against any event/action on specific SharePoint object. Event Receiver is a method that is called when any triggering action occurs on specific SharePoint object.

Types of Event Receivers: There are two types of event receivers.

(1) Synchronous event receivers:

  • They are known as ‘Before’ events
  • Synchronous event receivers are called before the actual event occurs and before SharePoint has written any content in Content Database, that’s why they are called before events
  • Events ending with “–ing” are named synchronous events. E.g. Item Adding, Item Deleting
  • Event is executed in the same thread as the triggering action is running.
  • You can cancel the running event
  • You can get HttpContext
  • You can display error message

(2) Asynchronous event receivers:

  • They are known as ‘After’ events
  • Asynchronous event receivers are called after the actual event occurs and after SharePoint has written content in Content Database, that’s why they are called after events
  • Events ending with “–ed” are named asynchronous events. E.g. Item Added, Item Deleted
  • Event is executed in different thread than the triggering action.
  • You cannot cancel the running event
  • You cannot get HttpContext
  • You cannot display error message

Event Receivers Level: Below are the event receivers - execution levels

  • Site(Site Collection) Events
  • Web Events
  • List Events
  • List Field Events
  • Item Events
  • Feature Events
  • Email events

We value your Feedback:

Page URL:

Name:

Email:


Suggestion:

© 2024 Code SharePoint