Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting with frames 2

Status
Not open for further replies.

rtgordon

Programmer
Jan 17, 2001
104
US
In my app, I verify the user has a cookie, and then I response.redirect to a login page if that fails. The login page loads in the current frame, though. I would like it to load as target=top. I didn't have any luck using that with response.redirect, so, I am assuming that it don't work. I tried to response.redirect to a page with this code

<html>
<head>
<script language=&quot;JavaScript&quot;>
function goHome() {
parent.top.location.href=&quot;default2.asp&quot;;
}
</head>
<body onload=&quot;goHome()&quot;>
</body>
</html>

but it don't work :(

Any suggestions... I know this one has to be easy, but I haven't had any luck searching.

Thanks!
gordon
 
Try using the frames properties

Javascript:

top.frames['frameset'].frames['bottom'].location=&quot;newpage.asp&quot;

example 'frameset' is the host page with two frames 'top' and 'bottom'

this should change the 'bottom' frame

 
this is the subroutine I use for a redirect that breaks out of forms

Code:
sub SafeRedirect(url)
Response.Buffer = true
Response.Flush 
Response.Write &quot;<html><head>&quot;
Response.Write &quot;<script language=&quot;&quot;javascript&quot;&quot;>top.location.replace('&quot; & URL & &quot;');</script>&quot;
Response.Write &quot;</head><body></body></html>&quot;
Response.End 
end sub

-Christian
 
err...meant subroutine that breaks out of frames
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top