开发者

Response.write and target frame

I am using two frames in my page. The page in Main fame will get the开发者_JAVA百科 input and Top frame has to display the result page.

I am using the following code in the mainframe page. But it shows

error:"Microsoft JScript runtime error: 'topFrame' is undefined"

Code:

  <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>");


ok, for starters (and no offence here), but frames suck. Could you try using iFrames?

If you use an iFrame, then you can have a tag like

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

then you can set the iFrame attribute

topFrame.Attributes.Add("src", "/homepage.aspx")


Try window.topFrame.location.href or parent.topFrame.location.href.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜