我在global_error中写了错误处理,并且在一个错误页面error.aspx中显示错误信息,但是现在有个问题,就是global_error中只是捕获页面级错误,而其他错误不可以捕获,比如我想跳转到一个不存在的页面,也就是404错误他就捕捉不到,我在webconfig中写了错误页面是可以捕获到这个404错误的,但是不可能除了页面错误就只有404错误啊,其他错误怎么办,总不能在webconfig中一个一个写吧,请教各位高手应该怎么做??
在global_error中的代码
protected void Application_Error(Object sender, EventArgs e)
{
   Exception Error = Server.GetLastError();
   if (Error != null)
   {
      Server.Transfer(this.Request.ApplicationPath + "\\Error.aspx");
   }
}在webconfig中的代码
<configuration>
  <system.web>
    <customErrors
     mode="On">
    <error statusCode="404"
     redirect="http://localhost/WebApplication1/404error.aspx"/>
    </customErrors>
  </system.web>
</configuration>