一个页面(main.aspx)用了3个IFrame嵌套了3个页面,想从某一个里面写个方法把当前的整个页面(main.aspx)替换成baidu.com 改怎么做?希望得到尽可能多的方法,谢谢~!

解决方案 »

  1.   

    在页面中写上
    top.location.href='http://www.baidu.com'
      

  2.   


    window.top.location.href = 'baidu.com';
      

  3.   


    还有吗?
    这种方法会吧上次?号后面挂的值加在baidu.com后面的······目前我就是用的这种方法,结果变成 baidu.com?userid=001
      

  4.   

    这个重新定向,绝对不会带任何参数。
    baidu.com?userid=001这个是不可能的。
      

  5.   

    parent.parent.location.href = "baidu.com"
      

  6.   

    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["MyDep"] != null && Request["MyNum"] != null && Request["MyName"] != null && Request["Dep_Limit"] != null && Request["ManagerId"] != null)
                {
                    Session["MyDep"] = Request["MyDep"].Trim();
                    Session["MyNum"] = Request["MyNum"].Trim();
                    Session["MyName"] = Request["MyName"].Trim();
                    Session["Dep_Limit"] = Request["Dep_Limit"].Trim();
                    Session["ManagerId"] = Request["ManagerId"].Trim();
                }
            }
        }
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            Session.Clear();
            if (Request["path"] != null)
            {
                this.Page.RegisterStartupScript("", "<script>top.location.href  = '192.168.2.26/Login.aspx'</script>");
            }
            else
            {
                this.Page.RegisterStartupScript("", "<script>top.location.href  = 'login.aspx'</script>");
            }
        }结果返回的地址是192.168.2.26/Login.aspx+第一个if里面判断的所有request挂的值
      

  7.   

    有没有办法可以清空 所有Request???
      

  8.   

    你看看login.aspx是不是做了什么处理
      

  9.   

    没做什么处理,就是把下面的request全部传了过来Request["MyDep"]!=null&& Request["MyNum"]!=null&& Request["MyName"]!=null&& Request["Dep_Limit"]!=null&& Request["ManagerId"]!=null晕啊······················
      

  10.   


    你这些代码Request["MyDep"]!=null&& Request["MyNum"]!=null&& Request["MyName"]!=null&& Request["Dep_Limit"]!=null&& Request["ManagerId"]!=null
    是在login.aspx.cs中吗
      

  11.   

    parent.parent.location.href = "baidu.com"
      

  12.   

    各位不用说了,其实是location里面会预留当前地址栏内的地址,所以location.href = "baidu.com"会在当前地址后面加上去
    问题还没解决,决定避开问题来考虑················撒分
      

  13.   

    top.location.href  = 'http://192.168.2.26/Login.aspx'