Original Title:

<nativehr>0x81020089</nativehr> in ItemUpdating (i.e. Synchronous) Event Receiver

Edited Question:

In the past when you created an item-based, synchronous event receiver that canceled the event and showed the user a message, you received custom SharePoint error page displaying your message. This is no longer the case and to achieve this behavior, which was the default in the past, you need to modify the Web.config as described below. Other than modifying the Web.config is there any method to display the custom error message to users as was done in the past?

Original Question and Additional Details:

I am receiving the above error in a "yellow screen of death" ASP.NET error page in an ItemUpdating event receiver where I have done the typical:

properties.Status = SPEventReceiverStatus.CancelWithError;
//It does not matter if I use Cancel or CancelWithError
properties.ErrorMessage = "You must be a member of the " + MarketNeedGroups.EngineeringManagers + " group to modify the " + field + " field";
properties.Cancel = true;

Some people seemed to think that it was due to the CustomErrors being set to "off" but that was clearly not the issue I was having as that was set to RemoteOnly on my dev box.

Another person suggested changing

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">

to CallStack="false" which I did and it corrected the issue. The amount of crazy answers I saw from people who clearly had no idea what was going on, however, lead me to question this as the best choice. Are there any other possibilities to correct this?


I went back and checked some old code that has been in production for the better part of a year now. In said code I perform the same cancel but in an ItemDeleting Event Receiver. If you see this article on MSDN you will notice that it should present the user with a much less scary custom SharePoint error message. In the past my ItemDeleting event receiver displayed the same style of custom error message. It no longer does this. It now presents the user with a the YSOD. I verified the settings of the Web.config from a backup dated from over a year ago and CallStack="true" was exactly the same.

I don't want to modify this setting if I don't have to, but since the chances of me figuring out what has changed are zero, I will just keep this setting in the Web.config set to false. I certainly do not want my users to see the YSOD page as this will generate helpdesk tickets because users will not actually read the message, they will just assume that there was some sort of error in code. There is even discussion of this issue in the MSDN article above in the comments section.

In the Asynch events the error page still seems to be displayed properly. Meaning this exact code does not generate a YSOD but displays the custom SharePoint error.

  • What's the question? If you won't want the YSOD, haven't you solved that? Or are you asking the best way to cancel the event? Or are you asking why the two settings?
    – Andy Burns
    Oct 4, 2012 at 16:19
  • Are there any other possibilities (than modifying the WebConfig as shown) to correct this? Oct 4, 2012 at 16:49
  • Are you asking "Are there other way apart from changing the Web.Config to change the error page shown in SharePoint?" I'm struggling to see what you're trying to 'correct' - SharePoint is behaving as I'd expect an ASP.NET application to behave.
    – Andy Burns
    Oct 5, 2012 at 10:14
  • @AndyBurns You might think this is normal behavior, but it wasn't what occurred in the past. Please see my edit. Oct 5, 2012 at 14:32

2 Answers 2


I am afraid, modifying the web.config is the only way here.

Also, apart from changing the CallStack = "false", you should also set the <customErrors mode="On" />. Here is the relevant part of your web.config showing the changes:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <SafeMode MaxControls="200"
            <customErrors mode="On" />
  • Pretty much what I figured. Any idea what caused the change in behavior? Oct 9, 2012 at 13:24
  • Hmmm here is a way to change the web.config programmatically. somebody might have done that maybe? stackoverflow.com/questions/3512974/… Oct 9, 2012 at 16:09
  • No, that would not have occurred. This also seems like a more wide spread issue than just my environment if you see the MSDN article I link to in the question. Oct 9, 2012 at 19:49
  • Just an FYI, it doesn't seem that the CustomErrors setting actually matters so long as the CallStack attribute is set to false. At least not as far as the scope of my question is concerned. Oct 10, 2012 at 12:29

The SPEventReceiverStatus enumeration now has a CancelWithRedirectUrl. If I understand correctly you want to show an errormessage to the user that informs why the action was cancelled. For an example see: http://msdn.microsoft.com/en-us/sp2010devtrainingcourse_listsandschemalab_topic4.aspx.

I hope this helps.

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.