Redirect out of a Frameset

D

David GB

If a page runnning in a frame does a redirect, the new page is loaded into
the same frame.

How do I do a redirect that 'looses' the frameset?

In html, you can create a link with "target=_top" and it replaces the entire
frameset.

But a reponse.redirect("NewPage.aspx Target=_top") becomes:
http://server/NewPage.aspx Target=_top

How do I do this? Can I stop it from parsing the space into %20, or is
there a different method altogether I should use?

David
 
T

Tim Williams

You could send back a HTML page with some javascript to load your
required URL into the top level window.
Should not mess with the history list.

<script type="text/javascript">
top.location.replace( "yourURLHere" );
</script>


Tim.
 
D

David GB

Smart idea. Thanks.

I would put that into the page 'OnLoad' procedure, right?

Could it trigger pop-up blockers, though?
 
T

Tim Williams

David,

If you just put it in the page it will execute without having to be
called from onload. AFAIK it will not trigger pop-up blockers since
you are not opening a new window. It will, however, fail if the user
has js disabled or is not using a js-capable browser, so beware of
that.

Tim.
 
D

David GB

Thanks. Very helpful.

David

Tim Williams said:
David,

If you just put it in the page it will execute without having to be
called from onload. AFAIK it will not trigger pop-up blockers since
you are not opening a new window. It will, however, fail if the user
has js disabled or is not using a js-capable browser, so beware of
that.

Tim.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top