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)
{
base.ItemDeleting(properties);
}
public override void ItemDeleted(SPItemEventProperties properties)
{
base.ItemDeleted(properties);
}
}
When I debug it, I find that only on ItemDeleted, I see two problems.
- Properties.ListItem is null and there is no other way to find which item is being deleted.
- 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?