Results 1 to 6 of 6

Thread: Server side redirect with HTML frames

  1. #1

    Thread Starter
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    Cool

    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!"

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  3. #3

    Thread Starter
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138
    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!"

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  5. #5

    Thread Starter
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    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!"

  6. #6
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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
  •  



Click Here to Expand Forum to Full Width