Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display popup alert before redirect

Status
Not open for further replies.

xcaliber2222

Programmer
Apr 10, 2008
70
US
Hello,

I am trying to display a popup alert before the redirect. The page redirects but I can't get the popup to display, but if I do a Response.End instead of Response.Redirect after the alert it displays.

Code:
if trim(session("TEST 123") = "Y") and (DB_RsCmd("PRIMARY_VENDOR") = "ABCD") then
Response.Write("<script>alert(TEST 123 dealers can only enter TEST 123 data. Please contact your administrator.');</script>")
response.redirect("TEST 123_restart.asp")
end if

If someone could show me what I'm doing wrong I'd sure appreciate it.

Thank you,
Alejandro
 
How about just do a client-side redirect?
[tt]
if trim(session("TEST 123") = "Y") and (DB_RsCmd("PRIMARY_VENDOR") = "ABCD") then
Response.Write "<script>" & vbcrlf
Response.Write "alert('TEST 123 dealers can only enter TEST 123 data. Please contact your administrator.');" & vbcrlf
Response.Write "window.location='TEST 123_restart.asp';" & vbcrlf
Response.Write "</script>"
end if
[/tt]
 
Thanks Tsuji. I'll try it out and let you know.

Thank you very much,
Alejandro
 
I am trying to display a popup alert before the redirect. The page redirects but I can't get the popup to display

I tried to do that years ago and finally decided it couldn't be done, but if I HAD to have it done then somehow it would have to happen with code on the new page...

Best regards,
-Paul
- Freelance Web and Database Developer
- Classic ASP Design Tips
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top