Hello,
Basic requirement: In our project we want to show a friendly error message in a modal popup when some exception occures during AJAX calls.
I tried the example given @ http://www.asp.net/AJAX/documentation/live/Tutorials/CustomizingErrorHandlingforUpdatePanel.aspx
When I create a separate ASPX page and follow the steps mentioned in that tutorial, it works well.
But when I try to follow the same steps in a DNN module, it doesn't work. Ofcourse I'm NOT adding any ScriptManager explicitly in the module. Instead I'm using the ScriptManager returned by DotNetNuke.Framework.AJAX.ScriptManagerControl(Page). Using this script manager I'm registering my ScriptManager1_AsyncPostBackError() method for the AsyncPostBackError event. But this method never gets executed. This is because whenever any exception occurs PageBase.Page_Error() method gets executed first [we are using DNN 4.9.0], which redirects the user to error page. As this method is declared private I can't even override it in Default.aspx.vb.
If I override OnError() method in Default.aspx.vb then it stops redirecting to error page. But in this case it doesn't cause the AsyncPostBackError event and I don't get the expected behaviour. In this case I'm able to show a modal popup on client side, but the error message received is always:
Sys.Webforms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.
The status code returned from the server was: 500
Instead what I want is to see the message that I set to ScriptManager1.AsyncPostBackErrorMessage inside ScriptManager1_AsyncPostBackError().
Is there any way to do it?
Thanks & Regards,
- Vivek Athalye