服务器端ASP.Net Ajax的异常处理

编程入门 行业动态 更新时间:2024-10-27 06:21:52
本文介绍了服务器端ASP.Net Ajax的异常处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用ASP的AJAX框架,我试图做的JavaScript所谓的web服务的一些异常日志记录。

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

看,我发现一些人的处理它们的客户端,并送他们回服务器。我想preFER没有这样做,因为它依赖于其他的服务器通话(如果它失败的第一次,发送一个请求,其他看起来并不像一个好主意,这让我改变我的所有来电)

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)

我看到一些其他人decorating他们所有的方法,提供的try ... catch块(这会导致重复的错误处理,但一个其他try catch块)。

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).

不过,我想实现类似于Global.asax中的东西的Application_Error()它处理每一个未捕获的异常(不,它似乎并没有被要求AJAX调用的方法例外)。

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).

是,即使可能吗?

推荐答案

使用 ELMAH - 它可以捕捉阿贾克斯错误。

Use ELMAH - it can capture ajax errors.

更多推荐

服务器端ASP.Net Ajax的异常处理

本文发布于:2023-11-24 21:32:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1626923.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器端   异常   Net   ASP   Ajax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!