In the middle of my event handler (for a button), I have an if/then
statement (using vb.net):
if (whatever) then
strScript="<script .......
strScript &= alert('This is an alert')
strscript &="</script>
' this is all an abbreviated script - - but you get the idea
response.write(strscript)
end if
response.redirect("another page.aspx")
the problem is that, with the Response.redirect after the if/then statement,
it skips the javascript alert and goes to the redirect
if I comment out the reponse.redirect, the javascript alert pops up fine
where am I going wrong?
Mike Collins - 18 Mar 2008 22:03 GMT
You need to put your alert on the page you are redirecting to. By adding a
querystring "hasAlert" or something, you can check to see if you need to show
the alert on the next page.
> In the middle of my event handler (for a button), I have an if/then
> statement (using vb.net):
[quoted text clipped - 12 lines]
>
> where am I going wrong?
Teemu Keiski - 19 Mar 2008 13:13 GMT
Or you can do the redirect in javascript with location.href='yourpage.aspx'

Signature
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
> In the middle of my event handler (for a button), I have an if/then
> statement (using vb.net):
[quoted text clipped - 12 lines]
>
> where am I going wrong?