you are testing it locally, try to access your page which will throw exceptions from another machine

解决方案 »

  1.   

    mode="On"的时候还是这样ya 
      

  2.   

    try the following, but access testerror.aspx from another machine (ask your friend to do it):1. web.config:
    <configuration>
       <system.web>
          <customErrors defaultRedirect="error.aspx"
             mode="RemoteOnly">
             <error statusCode="500"
                   redirect="error.aspx"/>
          </customErrors>
       </system.web>
    </configuration>
    2. error.aspx:
    error3. testerror.aspx:
    <script language="C#" runat="Server">
    void Page_Load(Object sender, EventArgs e)
    {
      throw new Exception("whatver");
    }
    </script>
      

  3.   

    谢谢你的回答。我遇到这样一个问题。上传文件>我的指定值,报错。我用该方法转到错误页面失败(我已经查阅了论坛前面所有关于这个问题的解决方法,好像没有一个可以解决.)。我不想改machine.config里面的4096,因为怎么改 都不是解决问题的根本.我想知道如何对这个错误进行处理.我感觉这个错误已经超越应用程序的级别.
    也就是根本等不到
    global.asax
    protected void Application_Error(Object sender, EventArgs e)
    {
    Response.Redirect("err.aspx");
    }
    发生.思归,各位大虾能否给点提示?
      

  4.   

    web.config里的自定义错误也根本等不到.
      

  5.   

    I could be wrong, but the only way I know is to use Application_Error in global.asax, you can test e.Message to see if it contains something like "max request length" exceeded
      

  6.   

    我想上传文件的出错应该是在machine.config级别。
    无法运行到application这个级别。
    错误在application_error前就发生了。我不知道如何去解决。btw:thank ur reply!
      

  7.   

    这个问题到此为止。
    我刚才查了微软的新闻组。
    asp.net上传是放到内存,既然住留内存,又和CLR机制有关系。我不知道如何来处理CLR的错误机制。