2

我在我的页面中使用了两个框架。Main 中的页面将获得输入,Top frame 必须显示结果页面。

我在大型机页面中使用以下代码。但它显示

错误:“Microsoft JScript 运行时错误:‘topFrame’未定义”

代码:

  <frame src="" id="topFrame" target="topFrame"  scrolling="no">
  <frame src="txtPage.aspx" target="topFrame" name="mainFrame">

  txtPage(MainFrame)
  Response.Write("<script>topFrame.location.href=\"Homepage.aspx\";</script>");
4

2 回答 2

1

好的,对于初学者(这里没有冒犯),但是框架很烂。您可以尝试使用 iFrame 吗?

如果你使用 iFrame,那么你可以有一个标签

<iframe src="" id="topFrame" target="topFrame"  scrolling="no" runat="server"></iframe>

然后你可以设置 iFrame 属性

topFrame.Attributes.Add("src", "/homepage.aspx")
于 2010-06-05T05:18:53.210 回答
0

尝试window.topFrame.location.hrefparent.topFrame.location.href

于 2010-06-05T05:17:57.067 回答