Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Using JS and Response.Redirect

    Hello,

    I am trying to use a .asp page to open a new window based on a javascript confirm --> window.open in another window.

    That works...but I want to then redirect the parent .asp page to another .asp page what actually happens is the .asp is redirected causing the javascript confirm to not be processed.

    Is there anyway to ensure that the response from the javascript confirm is handled by the enduser and then redirect?!??!


    <% asp code here %>
    <script language="javascript" type="text/javascript">
    if (confirm('OpenWindow?'))
    {
    window.open('window');
    }
    else
    {
    dosomestuff();
    }
    </script>
    <% Response.Redirect("another.asp") %>


    Please let me know of any tips/methods!!

    Thanks in advance
    Last edited by KrazyKid; 02-20-2003 at 06:12 PM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    OK, you want to confirm that the user really wants to do something in a pop-up window and if so redirect the parent .asp to another page, close pop-up window?
    I would rather be a lion for a day than a lamb that lives forever.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <% asp code here %> 
    <script language="javascript" type="text/javascript"> 
    if (confirm('OpenWindow?')) 
    { 
    window.open('window'); 
    } 
    else 
    { 
    dosomestuff(); 
    } 
    
    location.href='another.asp'
    </script>
    Would this work for you?

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks!!

    Allida...

    That worked, I dunno why it didn't dawn on me...I tried this instead of the location.href prior to posting here..

    //<%' Response.Redirect("somesite.asp?str" & str %>

    but it behaved the same as the symptoms of my original post...

    Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •