ASP+javascript
一个页面,用户如果没有成功登录,则不允许访问,自动跳转到login.asp该如何写?谢谢指导

解决方案 »

  1.   


    后台: 
      Response.Redirect("login.asp"); 或者前台JS: location.href="login.asp"
     
      

  2.   

    判断session里有没有你要的值  没有的话跳转
      

  3.   

    我新建了一个aaa.asp内容如下<%@LANGUAGE="javascript"  codepage="936" %>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><%
    if (Session("yonghuid") == "undefined" || Session("yonghuid") == "") 
    {
    Response.Redirect("index.asp");
    Response.End;
    }
    %>运行后,居然不能跳转。请帮看看,哪里出错了?
      

  4.   

    我新建了一个aaa.asp内容如下<%@LANGUAGE="javascript"  codepage="936" %>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><%
    if (Session("yonghuid") == "undefined" || Session("yonghuid") == "") 
    {
    Response.Redirect("login.asp");
    Response.End;
    }
    %>运行后,居然不能跳转到login.asp。请帮看看,哪里出错了?