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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

response.redirect

Status
Not open for further replies.

Zarcom

Programmer
May 7, 2002
1,275
CA
How can you set the window or form name the redirect is sent to?

Thanks ahead
 
you mean other than doing it in code?
;)

well, you could pass a parameter in the query string or in a session variable, and when the page loads it grabs that parameter/session and assigns it to its title bar?

Jack
 
mm not quite.

I have a page done in forms. Each page checks to see if the session variable loggedin exits. If it doesn't ie. the session has timed out, the page redirects to a login page.

Currently the redirect is taking place inside the main frame. This temporarily messes up the interface after a correct login as the menu on the side is twice repeated.

I would like the redirect to goto the main browser window rather than the form it is coming from. Is this possible to do with page-behind code?
 
Ahhh, now I see.

Just so we're on the same page:
you say you have a page done in "forms", but it sounds like what you mean is "frames", yes?

so when it directs, instead of showing up in the frame, you want it to show up in the entire browser, right?

shoot shoot shoot...I've done this before. We did a chat application over the web. The interface was made up of a frames page, and when the session timed out, the browser redirected to a page, no frames.

All my code is at work though.
:(
If no one posts any reply (or if my memory doesn't kick in) by Monday, I'll post what I did to resolve the issue then.

Sorry I can't be more help at this time Zar
:(

Jack
 
Hey guys,

I think you would have to be doing this in javascript with something like:
----------------------------------
top.document.location.href='somepage.html';
----------------------------------
this will break the frameset and make the referenced page open in the parent frame.

Hope this is what you are after :)

hads [smurf]
01101000011000010110010001110011
 
doh!
doh doh doh!!
Jack
Yes that is what I meant frames not forms. And yes we are on the exact same page here. After the session times out I need to break the out of the frameset

Hads
I know how do code the redirect itself in javascript but how do I get it to check the session before redirecting?

Thanks guys
[peace]
 
To add to the above, how about something like:

<%@language=&quot;javascript&quot;%>
<script language=&quot;javascript&quot;>
<!--
var bln_Redirect = <%=((Session(&quot;loggedin&quot;)==&quot;yes&quot;)?true:false)%>;
if (bln_Redirect) top.document.location.href='somepage.html';
//-->
</script>

BTW I haven't tested that at all .. may need to iron a few wrinkles out

codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Hey Zarcom,

k, here's what I did:

I added this sub to the page that I wanted to show in full screen.

<script language=&quot;JavaScript&quot;>
if (top != self) {
top.location = location
}
</script>

Thats all there is to it!
:)

Jack

PS: Sorry for the late reply :(
 
Thanks Jack but I think CodeStorm has solved it for me. I haven't tried his solution yet, but that is what I wanted, I had just thought you could do this from asp rather than javascript. [peace]
 
Ahhh, forgot about the session part.

Great code snipit CodeStorm, I'll have to remember that for when I need to incorporate session vars in my javascript
:)

Jack
 
Hehe, no problem, though looking back on my code I've got it backwards - should redirect on false. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top