How can I call Response.Redirect from within a frame to overwrite the whole browser window?

Created 2001-04-06

Question:

How can I call Response.Redirect <url> from within a frame so that the results of that ASP do not appear in the frame,
but instead overwrite the whole browser window?  Currently, when I do this and the asp from which Response.Redirect is called is in a frame, it just overwrites the frame.

Answer:

Use

<%
Response.write "<SCRIPT Language=VBScript>" & vbCrLf
Response.write "  window.open "URL", "_top" & vbCrLf
Response.write "</SCRIPT>
%>

This will write client side script that will load a new URL into the top level window (i.e.overwrite the frameset) and replace it.

 

Back to Non-Printer Version