如何获得这些页面的aspx抛出异常的Application_Error [英] How to get which page threw an exception to Application_error in aspx

查看:555
本文介绍了如何获得这些页面的aspx抛出异常的Application_Error的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大致的异常处理程序,在的Application_Error Global.asax的我在这里我想对我所有的许多页面所有未捕获异常隔离开来。我不想用PAGE_ERROR捕捉异常,因为它是低效的调用上这么多页。所以我在异常在哪里可以找到哪个页面实际上导致异常?


解决方案

 的HttpContext CON = HttpContext.Current;
con.Request.Url.ToString()

I have a general exception handler, Application_error in my global.asax where I'm trying to isolate all the uncaught exceptions on all my many pages. I don't want to use Page_error to catch exception because it's inefficient to call that on so many pages. So where in the exception can I find what page actually caused the exception?

解决方案

HttpContext con = HttpContext.Current;
con.Request.Url.ToString()

这篇关于如何获得这些页面的aspx抛出异常的Application_Error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆