错误页的local地址为http://localhost/PASS/404.aspxweb.config
写入了
<customErrors mode="RemoteOnly" defaultRedirect="/PASS/404.aspx"></customErrors>IIS
在default website下面的PASS的属性里面,自定义错误 404的属性改成了
message type: URL 
URL: /PASS/404.aspx可是当我输入一个错误的页地址例如http://localhost/PASS/123.aspx,还是会出现系统生成的那个白色的错误页The resource cannot be found.
Server Error in '/PASS' Application.
--------------------------------------------------------------------------------The resource cannot be found. 
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested Url: /PASS/123.aspx
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573 
是不是我设置的地方有什么错误,或者还有别的什么地方我没有改?
麻烦各位湘西说说,谢了!!!

解决方案 »

  1.   

    看看在protected void Application_Error(Object sender, EventArgs e)
    {
    //这里转到错误页面试试
    }
      

  2.   

    <customErrors mode="On" defaultRedirect="ErrorPage.aspx">
        <error statusCode="404" redirect="LoginReg.aspx" />
    </customErrors>see:
    http://www.codeproject.com/aspnet/JcGlobalErrorHandling.asp
      

  3.   

    <customErrors mode="On" defaultRedirect="/PASS/404.aspx">
      

  4.   

    孟子和luluso正解。也谢谢闭关。我刚刚查到mode的不同含义,刚才没注意到自己一直在发送本地请求。呵呵。Mode 属性确定是向本地客户端、远程客户端还是这两者显示错误。下表描述了每项设置的作用。 Mode          本地宿主请求      远程宿主请求 
    On            自定义错误页。    自定义错误页。  
    Off           ASP.NET 错误页。  ASP.NET 错误页。  
    RemoteOnly    ASP.NET 错误页。  自定义错误页。