|
-
Oct 11th, 2000, 10:06 AM
#1
Thread Starter
Addicted Member
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.
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Oct 11th, 2000, 11:30 PM
#2
Frenzied Member
I usually just use this:
Code:
<%
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.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Oct 12th, 2000, 02:46 AM
#3
Thread Starter
Addicted Member
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.
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Oct 12th, 2000, 09:46 AM
#4
Frenzied Member
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.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Oct 13th, 2000, 03:10 AM
#5
Thread Starter
Addicted Member
Nice1
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
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Oct 13th, 2000, 09:44 AM
#6
Frenzied Member
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)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|