关于FRAMESET框架的问题。
网站进来时一个框架。代码如下:
<FRAMESET border=0 frameSpacing=0 rows=98,* frameBorder=0>
<FRAME name=topFrame src="images/top.aspx" noResize scrolling=no>
<FRAMESET border=0 name=content frameSpacing=0 frameBorder=0 cols=166,*>
<FRAME name=BoardMenu marginWidth=0 marginHeight=0 src="images/menu.aspx" noResize scrolling=no target="main">
<FRAME id="main" name="main" marginWidth=0 marginHeight=0 src="home.aspx" noResize>
</FRAMESET>
</FRAMESET>
在右边页面上我点一个按钮打开一个模态窗口来修改右边页面上的数据。当我修改完后我想让它刷新或从新在右边框架内打开页面。我用了一下方法,但都报错。错误是。parent.frames['main'].location为空或不是对象!请高手帮忙看看。最好上点代码。能用加分
我试了一下几种:
Page.RegisterStartupScript("test", "<script>alert('金额设定成功');window.opener=null;opener.parent.frames.main.location.reload();window.close();</script>");
Response.Write("<script>alert('金额设定成功');window.opener.parent.main.location.href='CoursewareList.aspx';window.close();</script>");
Response.Write("<script>parent.frames['main'].location.href='CoursewareList.aspx'; window.close();</script>");
Page.RegisterClientScriptBlock("js", "<script>parent.frames(\"main\").document.location('CoursewareList.aspx').reload();window.close();</script>");
以上几个都不行。请高手看看