I am writing an event receiver that will log delete action (time and user only) of a deleted list item. Following is what it looks like.

public class AuditDeleteReceiver : SPItemEventReceiver
        public override void ItemDeleting(SPItemEventProperties properties)


        public override void ItemDeleted(SPItemEventProperties properties)


When I debug it, I find that only on ItemDeleted, I see two problems.

  1. Properties.ListItem is null and there is no other way to find which item is being deleted.
  2. ItemDeleted method is called as soon as item is deleted from list. I want this to be called when its being deleted from the end user recyle bin.

Is there anything that I'm missing?

2 Answers 2


You should definitely use the ItemDeleting event, log the delete action, and then remove the log entry if the item is restored from the recycle bin.

It's not a perfect solution, but there simply isn't an event to capture items being purged from the recycle bins.

EDIT: I went back and checked something I wrote a year or so ago...no event fires when the item is restored fromt he recycle bin. Had a timer job that was scanning AllDocs to see if the item was still there and whether or not DeletedTransactionId was still set. If it wasn't there it had been purged, if it was still there with DeletedTransactionId set it was still recycled, and if it was still there with DeletedTransactionId not set then it was restore. When I say scanning, I was doing indexed queries using the item's Id.

  1. This is correct. Properties.ListItem is empty on ItemDeleted, because this is after event and it is fired when the item is already deleted. You should be using ItemDeleting method if you need list item, because it is fired before item is deleted.
  2. This is also correct. There are no event receivers for recycle bin actions.

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.