asp.net怎么自定义404的错误页面?

解决方案 »

  1.   

    config  <customErrors mode="RemoteOnly" defaultRedirect="PageError.htm">
                <error statusCode="403" redirect="PageError.htm" />
                <error statusCode="404" redirect="PageError.htm" />
            </customErrors>
    或IIS设置或捕捉错误类型
      

  2.   


    正解。自己做个错误提示页面。配置好webconfig文件后,发生错误后会跳转到那边。
      

  3.   

    新建一个 Global.asax 文件。。void Application_Error(object sender, EventArgs e) 

       //在出现未处理的错误时运行的代码
       Server.ClearError();
       //你要跳转的404页面
       Response.Redirect("~/Sorry.htm");}