<system.web> <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors></system.web>

解决方案 »

  1.   

    customErrors mode="RemoteOnly"无法远程查看堆栈信息
    defaultRedirect="GenericErrorPage.htm"  表示发生为配置的错误就转向这个页
    下面表示 专门的错误转向哪个页
      

  2.   

    web.config里就有说明。 <!--
                如果在执行请求的过程中出现未处理的错误,
                则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
                开发人员通过该节可以配置
                要显示的 html 错误页
                以代替错误堆栈跟踪。        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->