我的框架页结构如下:
<frameset cols="154,*" frameborder="no" border="0">
    <frame id="tree" name="tree" src="tree.aspx">
       <frameset rows="55,*" id="main" border="0">
        <frame id="top" name="top" src="top.aspx" noresize="noresize" />
        <frame id="list" name="list" src="list.aspx" >
       </frameset>    
</frameset>我现在需要在top这个页面中某个按钮的提交事件中,刷新list.aspx,重要的是同时要给list传递一个参数。就是list.aspx?id=1  要传一个id过去

解决方案 »

  1.   

    top.aspx<input type="button" value="test" onclick="test();)>
    <script>
        function test()
        {
            window.parent.list.location.href="ist.aspx?id=1"; 
        }
    </script>
    你试试看行不.
      

  2.   

    谢谢,明天上班试下用response.write(“window.parent.list.location.href='list.aspx?id=1”)。我要在.cs里边写。执行下操作数据库的操作后再刷新。
      

  3.   

    top.aspx代码如下:<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    <script language="javascript">
    function test()
    {
    window.parent.list.location.href="list.aspx?id=1";
    }
    </script>
    </head><body>
    <input type="button" value="test" onclick="test();" />
    </body></html>
      

  4.   


    response.write(“<script language='javascript'>window.parent.list.location.href='list.aspx?id=1';</script>”)
      

  5.   

    试了不行  我这样写的 Response.Write ("<script language='javascript'>window.parent.list.location.href='list.aspx?pdid='" + this.ParentID.Value + "';</script>)");
      

  6.   

    汗一个先!!应该是parent.frames['list'].location.href而不是window.parent.list.location.href
      

  7.   


    你这样写不对的,首先,括号个数都不匹配,改为
    Response.Write("<script language='javascript'>window.parent.list.location.href='list.aspx?pdid=" + this.ParentID.Value +"'; </script>");
      

  8.   

    我上面的写法是把 this.ParentID.Value 当成取一个服务器端控件的值,如果那是个html控件,写法又不一样
    Response.Write("<script language='javascript'>window.parent.list.location.href='list.aspx?id='+ document.getElementById('txt').value ;</script>")
    假设top.aspx中有个id为txt的input.另外,Response.write后,客户端能看见你输出的内容,很容易判断对错的.
      

  9.   

    其实我知道这个在ff下可能会有问题,但是我没装ff,他最关键的错误不是这个,而是Response.Write后面的串写错了,连括号个数都不匹配,连IE都过不去,还拿ff说事儿有什么用.