Click to See Complete Forum and Search --> : Permission denied error


sniper
11-18-2005, 09:55 AM
Once again I am coming to you guys for help. I just hope you guys don't get sick of me. Anyway Here's my error:

Microsoft VBScript runtime error '800a0046'
Permission denied: 'msgbox'
/Login/GuestGOC.asp, line 149

and my code:

<td rowspan=2><a title="<%=trim(fctGetText("Sum_LoginForm1"))%>" href="<%
if request.form("txtLogin")= "" or request.form("txtPassword")= "" then
msgbox(replace(trim(fctGetText("enterPW")),"'","\"))
else
response.Write "ValidLogin.asp?Lang="+request.QueryString("Lang")+"&"+request.QueryString("Dept") end if%>">
<img alt="<%=trim(fctGetText("Sum_LoginForm2"))%>" src="../images/<%=Application("strProgramSource")%>/General/go.gif" width=35 height=34 border="0"></a></td>

Thank you for your help.

Giskard
11-18-2005, 10:07 AM
msgbox is a VB routine that is not allowed in ASP. Since ASP runs on the server the message box is trying to open a window on the server which is why you get a permission denied message. Since you need to remove all JavaScript you can't really pop up a window with the error message.

With ASP when you want to write an error message it is usually done by using a Response.write to output red text next to the input item that is invalid.

Bullschmidt
11-24-2005, 02:15 AM
Or perhaps try something like this "Yet to be developed" JavaScript alert box:
Response.Write "<script type='text/javascript'>alert('Yet to be developed.');</script>"

Or using a variable:
MyVariable = "Yet to be developed."
Response.Write "<script type='text/javascript'>alert('" & MyVariable & "');</script>"

Or with multiple lines:
Response.Write "<script type='text/javascript'>alert('Coming soon.\nYet to be developed.');</script>"