Click to See Complete Forum and Search --> : Server side redirect with HTML frames
Skeen
Oct 11th, 2000, 10:06 AM
Hi everyone,
I'm trying to use response redirect on an asp using html frames. I've been told that this is a real muthaF**ker, but thats as practical as the advice got. Can anyone shed any light on the method I need to use?
Cheers 'n' beers...
Skeen.
monte96
Oct 11th, 2000, 11:30 PM
I usually just use this:
<%
Response.Write "<SCRIPT language='JavaScript'>"
Response.Write "window.parent.parent.location.href='default.asp';"
Response.Write "</SCRIPT>"
Response.End
%>
which writes a small script block into the html stream that redirects the user to wherever I want from the client side.
Skeen
Oct 12th, 2000, 02:46 AM
I'm using vbscript, does this matter? I've tried inserting the code into my script but I keep getting an error saying expected 'End' , right at the end of my script where I set my recordsets back to zero.
Here is the part of my code my code in question, which is all server-side asp's using SQL and VBScript. Can you tell me how to integrate the client side script of yours.
Cheers Monte, nice1
Skeen.
monte96
Oct 12th, 2000, 09:46 AM
The code I posted is server side vbscript. It dynamically creates client side javascript that will execute on the browser and redirect as soon as it hits the response.end line.
The error your getting is due to a missing End If, End Sub, End Function, or End Select.
Skeen
Oct 13th, 2000, 03:10 AM
Cheers Monte, worked a treat. I'd used 'EndIf', when I tried 'End If' it worked. So the javascript thst is generated client side - how does that work? Does the JVM have in-built functions/modules for this kind of thing - or am I talking complete shite (lol)?
Thanks again
Skeen
monte96
Oct 13th, 2000, 09:44 AM
Essentially, the same way as if you place VBScript on a page without placing it in a function, it is executed, if Javascript is placed on a page w/o a function it is executed. And when it hits the response.end, the page is finished so it runs it on the client side and redirects. Using response.write you can create your entire HTML output from the <HTML> tag to the script to the content. It's not always the best way to do it, but it sometimes comes in handy like this and when you need to pass a server side variable to the client side so it can be used there once the page is loaded. (You can write the variable declaration using response.write and set it equal to the server side variable and it is output as a hard coded variable declaration on the client)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.