有没有一种办法,把错误的页面(代码出错)通通都跳转到一个指定的页面,
代码要怎么写的???

解决方案 »

  1.   

    在web.config中定义
    <customErrors mode="RemoteOnly" defaultRedirect="customerror.htm"> 
    <error statusCode="404" redirect="customerror404.htm"/>.
      

  2.   

    <customErrors mode="RemoteOnly" defaultRedirect="customerror.htm"> <error statusCode="404" redirect="customerror404.htm"/>.
    上边就是自定义的跳转了啊,为什么还用下边的呀??一定要两个同时用吗??
    404是一种错误类型吧??两个同时用的吗??如果都跳到同一个页行吗??
      

  3.   

    <customErrors mode="RemoteOnly" defaultRedirect="customerror.htm"> 
    就可以加上<error statusCode="404" redirect="customerror404.htm"/>.
    是可以特别指出一些错误的显示页面,可用可不用