SPItemEventReceiver class

Provides methods for trapping events that occur to items. This class is never instantiated.

System.Object
  Microsoft.SharePoint.SPEventReceiverBase
    Microsoft.SharePoint.SPItemEventReceiver

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

No code example is currently available or this language may not be supported.

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

If an item is moved, it is treated in the same way as an item that has been removed and then added.

Before and After properties are guaranteed for post events on documents, but Before properties are not available for post events on list items.

The following code example uses this class to add an item to a specified Announcements list whenever an attachment is added to a list.

No code example is currently available or this language may not be supported.
NoteNote

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: