I need to show an errormessage in a popup or redirecting to another page when an error occurs in the ItemAdded (not ItemAdding...) eventreceiver. Anyone knows how to do this?

I've tried:

 private void ShowErrorMessage(SPItemEventProperties properties, string message)
        properties.Status = SPEventReceiverStatus.CancelWithError;
        properties.ErrorMessage = message;
        properties.Cancel = true;

And set web.config values to CallStack="false" & customError="On". But I guess this only works for ItemAdding event?

Any other solutions for my problem?

1 Answer 1


You can't show a message from ItemXXXed and you can't cancel either. If you need that then you should implement ItemXXXing.

You can't cancel because the changes has already been made and you can't show a message because the UI isn't waiting for you (unless you specify synchronous, but still I don't expect SharePoint to look at Status)

  • I'm using the ItemUpdated because when I approve or reject a listitem, the workflow should start, which isn't the case if I use the ItemUpdating event (or am I wrong?) Commented May 24, 2012 at 11:05
  • 1
    The main difference between ItemUpdated and ItemUpdating is where the information is and what you can do. In ItemUpdating all the changes are only in properties bacuse the DB isn't changed and you can stop the change from happening. In ItemUpdated the change has been put into the DB (and listitem) and you can't stop the change. Unless cancelled they will always occur in pairs. Commented May 24, 2012 at 11:12
  • So there isn't any way to show a message to the user after he approves or rejects the listitem? Commented May 24, 2012 at 12:21
  • Not using event receivers in a nice way. A HACK could be to check in ItemUpdating if what's going on is a appove/reject, then perform the operation while Disabling events and CancelWithError, but that's definitly a hack and will confuse any program trying to Approve/Reject) Commented May 24, 2012 at 13:19
  • Why would you want to show the error message AFTER he approves/rejects the item?
    – Kit Menke
    Commented May 24, 2012 at 13:24

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.