我希望是获取当前网页的地址,跳转到login.aspx里面,然后等待3秒,再跳转到登陆前的页面。

解决方案 »

  1.   

    settimeout函数里面写window.location
      

  2.   

    可以传参啊。首先记录下现在的页面的URL。然后传到登陆页面
    登陆成功后
    response.write("<script>alert('登陆成功');location.href='"+URL+"'</script>")
    或者是
    response.redirect(URL);
      

  3.   

    可以传参啊。 首先记录下现在的页面的URL。然后传到登陆页面 
    登陆成功后 
    response.write(" <script>alert('登陆成功');location.href='"+URL+"' </script>") 
    或者是 
    response.redirect(URL);支持一下
      

  4.   

    第1步    用Response.redirect("login.aspx");并且传入一个标示比如id=wochuande第2步    在login.aspx上面的Load事件中检索是否有这个id=wochuande如果有的话,代表这个界面是经过我指定的界面跳转过来的,然后执行我的步骤,调用延时函数3停留3秒  然后response.redirect("您要的地址")  思路我都已经说了 ,是这个样子的,至于调用延时函数好像是sleep什么的  你查下 我给忘了 
      

  5.   

      想知道怎样获取那个Url...
      

  6.   

    在前一个网页里面这么写 Response.Redirect("login.aspx?fromUrl=" + System.Web.HttpContext.Current.Request.Url.AbsoluteUri.ToString());
     在login.aspx里面这么写 <meta http-equiv="refresh" content="10; url=<% =Request.QueryString["fromUrl"].ToString() %>" /> 
      

  7.   

    Request.UrlReferrer
    获取有关客户端上次请求的URL信息
      

  8.   

    ……登陆成功之后
    string strURL=request["ReturnURL"];//这个是用户请求的页面路径
    System.Web.Security.FormsAuthentication.SetAuthCookie(user.Name,true);//给用户颁发Cookie凭证
    if(strURL==null)
    {
       //用户原请求页面为空时
       Reaponse.Redirect("aaa.aspx");
    }
    else
    {
       Response.Redirect(strURL);//用户原请求页面不为空时,转到请求页面
    }
    ……
    ====
    用户退出
    System.Web.Security.FormsAuthentication.SignOut();
      

  9.   

    用的是Login控件和MemberShip组件。
      

  10.   


    那个ASP.NET 有身份验证,就是你没有登录的话匿名用户只能访问你自己定义的几个页面。然后跟与那个URL返回你以前单击的页面。自己去搜下ASP.NRT身份验证,然后在接合我给你的代码看下就知道了。WENCONFIG 中还要加东西,这里我就不给出来了。
                if (Is_Valid_code)
                {
                    if (Is_Valid_User)
                    {
                        //-------------读取用户权限
                        string Power_ID = db.MyDR.GetSqlValue(0).ToString();
                        //创建一个验证票据
                        FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, TextBox_UserName.Text.Replace(" ", ""),
                            DateTime.Now, DateTime.Now.AddHours(1), true, Power_ID);
                        
                        //进行加密
                        string cookieStr = FormsAuthentication.Encrypt(ticket);                    //创建一个cookie,cookie名为web.config设置的名,值为加密后的数据cookieStr,
                        HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, cookieStr);
                        cookie.Path = FormsAuthentication.FormsCookiePath;//设置cookie保存路径                    //--------------读取要保存的时间
                        if (RadioBtnL_CookieTime.SelectedItem.Text == "一小时")
                        {
                            cookie.Expires = DateTime.Now.AddHours(1);
                        }
                        else if (RadioBtnL_CookieTime.SelectedItem.Text == "即时")
                        {
                            //如果是即时的话不用设置cookie过期时间浏览器关闭后cookie自动消失
                        }
                        else
                        {
                            int x = Convert.ToInt16(RadioBtnL_CookieTime.SelectedValue);
                            cookie.Expires = DateTime.Now.AddDays(x);
                        }                    Response.Cookies.Add(cookie);                    string strRedirect = Request["ReturnUrl"];//取出返回url
                       
                        if (strRedirect == null)
                        {
                            strRedirect = "index.aspx";
                        }
                        Response.Write("<script language=javascript>alert('登录成功,欢迎访问本论坛');location='" + strRedirect + "'</script>");