当加载数据时可能由于各种原因导致加载失败,这个时候会弹出代码错误页面,想自定义一个页面,出错后就直接跳转到定义的错误页面,求指导

解决方案 »

  1.   

    可能报错的地方的catch  跳转呀
      

  2.   

    在config里设置一下,加个<customErrors mode="On" defaultRedirect="Error.htm"/>,指定错误页面就可以。
      

  3.   

    在config里设置一下,加个
    <customErrors mode="Off"  defaultRedirect="Error.aspx" >
          <error statusCode="403" redirect="Error.aspx?go=403"/>
          <error statusCode="404" redirect="Error.aspx?go=404"/>
        </customErrors>指定错误页面就可以。
      

  4.   

    try{
    }catch{Response.Redirect();
    }
      

  5.   

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

  6.   

    http://topic.csdn.net/u/20111202/10/02ec7967-8bf3-4d09-bb23-91281023ee6c.html
    这里有写到哦。
      

  7.   

    3、4楼正解。也可以在Application_Error(object sender, EventArgs e)事件中进行处理,先记录错误日志,然后在跳转。