Asp – Server-side ASP.Net Ajax exception handling

asp.netasp.net-ajax

I am using ASP.net's AJAX framework and I am trying to do some exception logging on the javascript-called webservice.

Looking through the web, I find some people handling them client-side and sending them back to the server. I'd prefer not doing that since it relies on an other server call (if it failed the first time, sending an other request doesn't look like a good idea and that makes me change all my calls)

I see some other people decorating all their methods with try… catch blocks (which leads to duplicate error handling, and yet an other try catch block).

However, I'm trying to achieve something similar to global.asax's Application_Error() which handles every uncaught exception (nope, it doesn't seem to be called for AJAX called methods exceptions).

Is that even possible?

Best Answer

Use ELMAH - it can capture ajax errors.

Related Topic