How do I change the target frame of a Response.Redirect?   
 

With client-side code, such as top.<target>.location.href= ...
ASP is on the server and does not "see" frames.

Instead of response.redirect, use code like this:

<%
  url = "http://domain.com/"
  response.write("<script>" & vbCrLf)
  response.write("targetframename.location.replace('" & url & "');" & vbCrLf)
  response.write("</script>")
%>
Or this:
<%
url = "http://domain.com/"
response.write("<script>" & vbCrLf)
response.write("targetframename.location.href='" & url & "';" & vbCrLf)
response.write("</script>")
%>

Notes: The replace() function doesn't muck up the history list. Using the following syntax creates headaches on certain 3.0 browsers:

  response.redirect("javascript:framename.location.href='wherever';")

Avoid using that one unless you're in a controlled environment or you've tested it across your target audience.

If it is a form you're submitting to, you can use the following:

<form method="post" action="page.asp" target="framename">

 
My3C's
perrychicker
It's easy... it's a PSACAKE!
Back | Tell A Friend | Search this Site
1998 - 2014 psacake.com
Version 3.23

Send me One Million FREE Guaranteed Visitors