在MVC.Net中,如果我们想做一个统一的错误处理的模块,有几个选择,一种是通过一个Base Controller来实现,另外一种就是在Global.asax中实现.这里介绍后一种方法. 首先打开Global.asax文件,然后添加如下代码: /** * 捕捉系统级错误 **/ void Application_Error(object sender, EventArgs e) { // We clear the response Response.Clear(); // 获取错误类 Excep…