public override void ItemDeleting(SPItemEventProperties properties)
{
try
{
properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = SPUtility.GetLocalizedString("$Resources:MyResources,ER_DeletionError", "MyResources", properties.Web.Language);
}
finally
{
//_currentContext.Response.Redirect(properties.WebUrl, true);
}
}
Now it works fine, it doesn't deletes the item, but when i click on "OK" for error message, item disappears from screen and comes back only when i refresh the page, any clues ?
Edit
It only happens when your list is opened in "Edit in Datasheet" view, otherwise it takes you to another window with error.