Results 1 to 4 of 4

Thread: Response.redirect

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Angry Response.redirect

    Hello,

    I want to give the user the opportunity to register for using my website. Here is the code which I want to use. My question is - how can I open a NEW(!!) screen if I see that the user has NOT registered before?? Needless to say, the response.redirect target=blank - does not work!!

    Code:
    <%
    dim checkCookie
    
    checkCookie = request.cookies("pq")
    
    if checkCookie = "" then
    	response.redirect("register.asp  target=_blank")	
    end if
    Thanks,
    T

  2. #2
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303
    You'll need some Javascript first off.
    <script language="JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features)
    { //v2.0
    window.open(theURL,winName,features);
    window.blur();
    }
    //-->
    </script>

    Then in your asp code

    If checkCookie="" then
    MM_openBrWindow('logon.asp','windowname','status=yes,width=795,height=595')
    End if

    Not 100% sure if this is the right way of calling Javascript from within ASP code, I use this mainly in BODY OnLoad=""

    Hope this helps though
    Thanks in advance for any help provided.

    VB 6 Enterprise Edition SP4
    ADO, SQL 7/2000, ASP and some JavaScript


    >> Life goes on, but for how long? <<
    If you can smile when things go wrong, you have someone in mind to blame

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Not 100% sure if this is the right way of calling Javascript from within ASP code
    You can't call client-side javascript from server-side ASP. You would have to write the javascript code to the client.

    More like this:

    VB Code:
    1. If checkCookie="" then
    2. Response.Write "<body onload='
    3. MM_openBrWindow('logon.asp','windowname','status=yes,width=795,height=595')'"
    4. End if
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Smile Thank you

    Thanks guys, it works great!!

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