Redirect an IFrame's Parent Page: Server-Side Code

G

Guest

How can an IFrame's aspx page force a server-side redirect on its parent
page? Typically, an IFrame's client-side javascript specifies '_top' to
change the parent page...

window.open('default.aspx?SMID=18', '_top', '', false);

However, the server-side Redirect doesn't include '_top'.

I tried to write the following from server-side code hoping it would execute
immediatly at the client but it won't fire, I'm not sure why:

Response.Write("<script
language=javascript>window.open('default.aspx?SMID=18', '_top', '',
false);</script>");

Please let me know if you have any ideas and thanks in advance for any help,

Mike
 
G

Guest

I isolated the problem and believe it is a bug. The method, window.open()
stops working if the IFrame's zone has not been given adequate time to be
resolved, i.e. "Unknown Zone". If the zone has been resolved then then
window.open() works and the top window can be replaced.

Interesting enough, if you click a link (non javascript) before the IFrame's
zone is resolved the top page changes:

<a href="foo.aspx" target=_top>foo</a>

However, window.open will stop working if you click it before the IFrame's
zone has been resolved:

<a href='javascript:window.open("foo.aspx", "_top", "", false)'>foo</a>

I still need to automate server-side code that changes the _top url from
within an IFrame's aspx page. Please let me know if you have any ideas,

Mike
 
S

Sheryl Landon

Hi Mike (or anyone else listening ;-):

Did you happen to find a solution for this? I'm battling the same problem.
Thanks,
Sheryl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top