摘要: 问题:如果在一个B/S项目代码里没有执行try……catch,但又需要每次发生异常都跳转到一个友好的提示页面,而该项目中有上百个页面,不可能每个页面都再去加try……catch,请问你如何解决?解决方案:1、在Global.asax捕获整个解决方案中的异常错误protected void Application_Error(object sender, EventArgs e) { try { Server.Transfer("Error.aspx"); } catch { } } Error.aspx:Exception ex = Server.GetLastError( 阅读全文
posted @ 2011-07-19 19:20 _Cafebabe 阅读(416) 评论(0) 推荐(2) 编辑