Create SharePoint List Item Event Handler

This is an example of how to create a SharePoint list item event handler. It will be fired when a new items is created, deleted or updated.

Reference
Microsoft.Sharepoint (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll)

Code
public class MyEventHandler : SPItemEventReceiver {    public override void ItemAdded(SPItemEventProperties properties) {        // Perform your code here // properties.ListItem is the current item that is being actioned. // Don't forget to invoke the base class event handler base.ItemAdded(properties); }    // Other methods you can override are: ItemAdding, ItemDeleting, ItemDeleted, // ItemUpdating, ItemUpdated and etc... }