main.aspx中有两个iframe,
<iframe src="Top.aspx" name="top" ></iframe>        //头,导航
<iframe src="GBook.aspx"  name="content"></iframe>  //内容
在top.aspx中有个linkbutton,单击linkbutton时 框架content中的页面变为GBook.aspx?ID=id其中 id的值为sesson[“userID”]的值意思是获取session,单击linkbutton时隐式提交有知道的朋友麻烦告诉下

解决方案 »

  1.   

    在Top.aspx.cs的Page_Load中:
                LinkButton1.Attributes.Add("target", "Content");
                LinkButton1.Attributes.Add("href", "WebForm1.aspx?ID="+Session["userID"].ToString());
      

  2.   

    首先谢谢你我用的是
    public static string id;
        protected void Page_Load(object sender, EventArgs e)
        {
            id = Session["userID"].ToString();  
        }前台是
        href="GBook.aspx?ID=<%=id %>" target="content" 
    这样能实现,我的意思是想在前台获取session 然后隐士提交,看了很多用JS的,但是我用的时候实现不了
      

  3.   

    如果你要在LinkButton的Click事件中处理某些事情再另content的页面跳转的话,可以这样:
            protected void LinkButton1_Click(object sender, EventArgs e)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "window.top.frames[\"content\"].location.href='GBook.aspx?ID=" + Session["userID"].ToString() +"';", true);
            }这样就不用在Page_Load中加那两句话了
      

  4.   

    不太明白你的在前台获取Session然后隐式提交是什么意思
      

  5.   

    把linkbutton替换为
    <a href=''></a>转向
      

  6.   

    意思是通过JS获取session值(id),然后再href中 用GBook.aspx?ID=后面是id的值有的写了个JS  在JS中取得Session值  然后再链接
      

  7.   

    href="GBook.aspx?ID= <%=Session["userID"]==null?"":Session["userID"].ToString()%>" target="content" 
      

  8.   


    private void XINXI_Click()
        { strID = Request["id"]; LinkButton1.PostBackUrl = "xinxi.aspx?id=" + strID + ""; }
      

  9.   

    用什么也行,linkbutton也行,<a>也行,我想知道的是方法
      

  10.   


    protected void Page_Load(object sender, EventArgs e)
        {
    XINXI_Click();  }
      

  11.   

    <script type="text/javascript" language="javascript">
    function GetSession()
    {
        //先判断其是否存在
        if(String(<%=Session["UserID"] %>)=="")
        {
            alert("不存在该Session值");
            return;
        }
        else
        {
            alert(<%=Session["UserID"] %>);
        }
    }
    </script> 
      

  12.   


    protected void LinkButton1_Click(object sender, EventArgs e)
        { XINXI_Click(); }
      

  13.   

    Session["userID"].ToString()-----〉strID
      

  14.   


    首先应在Top.aspx 的页面加载事件中为LinkButton1添加客户端属性或事件
    string id=Session["userId"].ToString();
    LinkButton1.Attributes.Add("target", "Content"); 
    LinkButton1.Attributes.Add("href", "WebForm1.aspx?id="+id);
    target 属性是在iframe框架中定义在一个子框架中链接反映页面在另一个页面中