-
Hi all, i am a pretty avid VB programmer and am trying to break into vbscript.. im trying a few tutorials but am having a problem with msgbox function..
when the page runs.. everything else loads, i just get this error message:
Permission denied: 'MsgBox'
why is permission denied, how do i get around this.
thanks in advance
-
Are you using this on an ASP page?
I could be wrong about this but Im not sure the msgbox function is integrated in ASP.
It might be because ASP scripts are processed server side and then sent to client in HTML format and msgbox docent exist in HTML.
The ASP code couldnt just wait for a user response like vb does. Still thats my thoughts - anyone know for sure?
You could use the Javascript alert("hello") to accomplish some of the stuff you can with msgbox.
Alex
-
TY
alexmac:
first, thanks for the reply.. the reason i was using msgbox in asp coding is because a tutorial on another site had it..so i was just trying it.. I am pretty sure it is possible, considering vbscript does have a msgbox function.. it does seem kinda silly though to have the browser wait for the user to transfer control back..
-matt
-
Yes I take your point about vbscript having the msgbox function but it would make sense for ASP pages not to support it as the server processes a page and then sends it. There is no waiting around for a response.
Let me know if asp does support it through
Alex
-
try declaring it as normal vbscript... i.e
<script language="vbscript">
MsgBox "hello"
</script>
Just a thought... I had problems with this too...
Oh well, Good Luck ;)
-
Cool that works. Sorry MetallicaD thought you were trying to do this in ASP from the error message.
Alex
-
2 things. using MSgBx will not work in ASP because it would only show up on the server if it did.
da_silvy's example will not work in netscape
-
but it will work in IE though?
-
Begin Useless Info
The MsgBox can't work on a server because the web server is running in the context of something like System or Anonymous Web User and doesn't actually have a desktop to display the MsgBox to.
End Useless Info
It should work on client side VBscript in IE because it's the VBScript equivalent to Javascript's alert.
Josh
-
I realise that you are just donig a few tutorials but...
Personally I think you should use Javascript on the client side so your pages are accesable to more people.