asp.net里 怎么让点击找不到的页的时候 转向友情提示页面

解决方案 »

  1.   

     <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
          <error statusCode="403" redirect="NoAccess.htm"/>
          <error statusCode="404" redirect="FileNotFound.htm"/>
        </customErrors>我WEBCONfig里这么写的 可是不好使
      

  2.   

    修改web.config文件中<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>404就表示找不到资源,楼主可以自定义页面
      

  3.   

    这个只对.aspx的服务器端页面好使
    .html和.htm的得在IIS中设置
      

  4.   

    http://msdn.microsoft.com/zh-cn/library/h0hfz6fc(VS.80).aspx
      

  5.   

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
    application_error
    IIS中配置转向页面
      

  6.   


    UserDB user = new UserDB();
    if(user.IsValidUserLogIn(texUserName.Text,texPassWord.Text)==true)
    {
     FormsAuthentication.SetAuthCookie(texUserName.Text,ture);
     Session["UserID"]=texUserName.Text;
     Response.Redirect("SearchCars.aspx");
    }
    这个是我的一个页面跳转的页面,就是说如果登入成功,就跳到SearchCars.aspx页面~
    你可以参考一下这个~~