我在我的页面中使用了两个框架。 Main fame中的页面将获得输入,并且Top框架必须显示结果页面。Response.write和目标框架
我在主机页面中使用以下代码。但它表明
错误: “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>");
注意:我使用了一个.NET示例,因为我“假设”您使用的是.NET ...很抱歉,如果我错了。 – 2010-06-05 05:20:24
我会尝试相同的方法,但用''。基本上,在代码中runat =“server”'的任何东西都可以让你从后面的代码中操作它。在这种情况下,'Attributes.Add' – 2010-06-05 05:30:55
您可以将'topFrame'变量存储在某种全局变量或会话变量中吗?然后,您可以从放置代码的页面调用该变量。topFrame.Attributes.Add(“src”,Session(“topFrame”)' – 2010-06-05 05:38:57