在main.aspx中有这样一个表单,是在我点击按钮后弹出来的,初始化进来只能看见按钮,点击按钮后弹出表单<form name="" method="post" action="a.aspx" target="iframeA">
<iframe name="iframeA" style="display:none">
 <table>
......
 </table>
</form>我本意是提交不成功时,表单中的内容不清空,但是提交成功后就刷新下,现在成功提交后但是无法在a.aspx.cs中用response.write("<script type="text/javascript">window.location.href="main.aspx"</script>")
来刷新main.aspx这个页面了请问高手们有什么办法刷新吗?

解决方案 »

  1.   

    response.write("<script type="text/javascript">parent.location.href="main.aspx";</script>")
      

  2.   

    response.write("<script type="text/javascript">window.location.href="main.aspx"</script>")
    window.location.href="main.aspx" 这个路径应该换成跳转到当前iframe里显示的页面吧
      

  3.   

    应该是可以的!
    Response.Write("<script>window.top.location.href='main.aspx'</script>");

    Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "window.top.location.href='main.aspx'", true);
      

  4.   

    ("<script type="text/javascript">window.parent.location.href="main.aspx"</script>")试试
      

  5.   

    window.top.location.href=''这个是可以,我这个用的是frameset框架,他帮我把左边的窗口刷的没有了
      

  6.   

    在main.aspx的加载事件中使用一下刷新方法,试一下!
      

  7.   

    根据就没进main.aspx,我设断点看了的所以刷也没用呵呵,window.top.location.href=""是可以,但是把我左边菜单栏刷的没有了
      

  8.   

    window.top.location.href=""后面是否写的你框架的地址
      

  9.   

    Response.Write("") 
    直接写Js脚本不就行了吗
      

  10.   

    Response.Write("<script>window.top.location.href='main.aspx'</script>");
      

  11.   

    window.top.document.frames.FrameNameOrID.src=window.top.document.frames.FrameNameOrID.src
      

  12.   

    Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "document.getElementById('ifrm').src='main.aspx'", true);ifrm是Iframe的ID
      

  13.   

    你的Frameset的名称是什么?
    如果是mainFram,则刷新代码是
    Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "window.parent.parent.frames.topFrame.location.href='main.aspx'", true);
      

  14.   

    15楼打错了,应该是:
    如果是mainFram,则刷新代码是
    Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "window.parent.parent.frames.mainFram.location.href='main.aspx'", true);
      

  15.   

    父窗口写个js方法,设置一个隐藏的button,这个button的onclick调用这个方法
    这个方法就是刷新特定的iframe
    子窗体中调用Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>window.parent.document.getElementById("Button1").click();</script>");
      

  16.   

    跳转页面 window.top.location.href=''