...

View Full Version : Using JS and Response.Redirect



KrazyKid
02-20-2003, 05:08 PM
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

ecnarongi
02-20-2003, 05:21 PM
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?

allida77
02-20-2003, 06:02 PM
<% 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?

KrazyKid
02-20-2003, 07:29 PM
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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum