[英]Response.write and target frame
我在页面中使用了两个框架。 Main fame中的页面将获得输入,并且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>");
好的,对于初学者来说(这里没有冒犯),但是车架很烂。 您可以尝试使用iFrame吗?
如果您使用iFrame,则可以使用类似
<iframe src="" id="topFrame" target="topFrame" scrolling="no" runat="server"></iframe>
那么您可以设置iFrame属性
topFrame.Attributes.Add("src", "/homepage.aspx")
尝试window.topFrame.location.href
或parent.topFrame.location.href
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.