在iframe裡刷新父窗口中的控件?a.aspx
=============
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
<iframe  id="frameNavigation"  frameborder="0" runat ="server" src="b.aspx" style="width: 100%; height: 205px;"></iframe>
怎樣在b.aspx裡怎樣刷新a.aspx裡的GridView1控件呢

GridView1.DataBind();

解决方案 »

  1.   

    在b.aspx里通过javascript让a.aspx重新刷新。parent.location.replace(parent.location.href);
      

  2.   

    同意楼上,GridView 是后台,编译到前台就是普通的Table, 页IFrame 里调用只能用JavaScript 前台操作。
      

  3.   

    Response.Write("<script>top.location.href='Uindex.aspx';</script>");
    Uindex是要刷新的网页名字。
      

  4.   

    你可以把GridView1.DataBind(); 写在Uindex.aspx的page_load 里就可以啦。
      

  5.   

    我是通過 Response.Write("<script>parent.location.replace(parent.location.href);</script>");刷新是成功了,但a.aspx 網頁內容變了,怎樣保持內容不變呢,a.aspx裡的gridview1內容是通過條件查詢出來的,條件是通過a.aspx上的輸入來組合的,現在看來是查詢條件丟了 也就是a.aspx上的textbox之類裡的輸入內容丟了我在b.aspx裡修改了數據庫,想通過刷新a.aspx 裡的 gridview 目前內容
      

  6.   

    把查询条件传给b,b再给a的隐藏表单回传参数。查询的时候用隐藏表单的语句。
      

  7.   

    直接在a.aspx裡加個button,手動刷新不錯,但不方便
        protected void Button2_Click(object sender, EventArgs e)
        {
            GridView1.DataBind();
        }