c# - Asp.net handle errors on certain pages differently -


I have an Application_Error handler in my Global.asax file. However, I use multiple pages using an XHR request Instead of an error page, this "sub page" will return the JavaScript or a real 500 code back to my main app for the process.

Is it possible to handle errors on some pages in some other way? Can a master page handle its errors in any page, without increasing the bubbling up to the Global.SX?

Thank you!

The cause of your Global.asax error is handled, because it does not have any hidden exception The back handler for. Be sure to handle your errors (try {} hold {}) where you are requesting asynchronous

I think you should also change the response code, so your code 500 will respond if you catch the exception.

Usually I want to return an error message and would like to display it as a JavaScript alert if the functionality is broken by an unsuccessful request.

Am I not sure that the master page can handle the errors of its encapsulated pages? For some reason do not you place your asynchronous end point in your .ynx file?

Comments