Here's what works for me
http://www.codingforums.com/archive/index.php/t-51986
You are using a response.Redirect in the same if then statement which
basically cancels the javascript alert even though the alert is listed above
the redirect.
If this is page is referenced from a form on a different page and that is
what you are redirecting to then you have multiple options.
1) You can rewrite it so that the the form and the form handler are on the
same page. Basically it will then do a postback to itself so then you can do
the alert on eof like you are doing or you can spell out an error on the page
in case the user has a non javascript enabled browser.
And if it isnt the same page being redirected to then you have two more
options
2) You can add a delayed redirect using javascript or a refresh metatag
3)redirect to the other page and pass a variable along with it. Then on the
redirected page use an If/Then statement looking for that variable. Then if
it is true the javascript alert is triggered. like so
on Refering page
if recordset.eof then
recordset.close
Set recordset= Nothing
Response.Redirect "StaffingReview.asp?1"
(IF Multiple send back - Response.Redirect"Staf.asp?a=1&b=2"
End If
On StaffingReview.asp
dim e
e = Request.Querystring
e = Request.Querystring("a") - for multiple
If e = 1 Then
Response.write("<script type=""text/javascript"">alert(""What is the
employee's ID Number? If unavailable enter N/A. Re-select your employee
before filling out the rest of the form."");</script>")
End If
vBulletin v3.0.0, Copyright ©2000-2005, Jelsoft Enterprises Ltd.
"Bob Barrows [MVP]" wrote:
Somebody posted an example a while back of response.writing a client-side
script block containing a statement that would be executed in the
window_onload event. Something like this:
<%="<script type='text/javascript'>msgbox 'some message'</script>"%>
Bob L wrote: As a followup question, is there a way I can code in MsgBox in the
.asp page so that it is processed on the client computer after being
process by the server?
"Bob L" <no****@nospam.com> wrote in message
news:OY****************@TK2MSFTNGP10.phx.gbl... That makes sense. Thanks.
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OC***************@TK2MSFTNGP12.phx.gbl...
Bob L wrote:
> I've inserted a MsgBox in some VBScript on line 12 of an .asp page
> and get the following error:
>
> Microsoft VBScript runtime error '800a0046'
> Permission denied: 'MsgBox'
>
> /default.asp, line 12
>
> The script processes a form and other than this problem with
> MsgBox, the script works fine. I've Googled the error but so far
> haven't found an answer that applies. Any idea what the problem
> might be and how I can get it to work?
You can't use MsgBox in server-side code. Think about it. Who will
be at the
server's monitor waiting to click the OK button?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will
get a quicker response by posting to the newsgroup.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.