0 out of 1 rated this helpful - Rate this topic

SPListEventReceiver Class

Provides methods to trap events that are raised for lists. This class is never instantiated.

System.Object
  Microsoft.SharePoint.SPEventReceiverBase
    Microsoft.SharePoint.SPListEventReceiver

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
[SubsetCallableTypeAttribute]
public class SPListEventReceiver : SPEventReceiverBase

The SPListEventReceiver class is not instantiated, but the list event receiver class of a custom event handler must derive from this class and override its methods for the event types that are handled.

The SPListEventReceiver class notifies registered entities of list schema events, supporting list schema operations and the addition or removal of content types.

Like other events, list events come in both Before synchronous and After asynchronous variants. List events are not generally raised as the result of a bulk operation. For example, creating a new Microsoft SharePoint Foundation list inherently creates a set of fields, but FieldAdding events are not raised.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Understand Event Receiver Scope
Many of us got confused about Event Receiver Scope (Site , Web) and here is little clarification about it
if the Event Receiver project item has been added to a feature with an activation scope of Site, the event handlers are
registered for every Host(List,List item ,Content Type..etc) in the current site collection. However, if the Event Receiver
project item has been added to a feature with an activation scope of Web, the event handlers
are registered only for Host in the current site
Events not fire on subsites
If event receiver is added by a site collection scoped feature (Scope="Site"), list events fire only on root site within site collection, not on subsites!