msgbox

  • Thread starter Thread starter Music Lover
  • Start date Start date
M

Music Lover

when I add a msgbox("hello")
it returns
"It is invalid to show a modal dialog or form when the application is not
running in UserInteractive mode. Specify the ServiceNotification or
DefaultDesktopOnly style to display a notification from a service
application. "

What should I do in order to make a msgbox work?
Thanks in advance
 
Hi

pls post code that cause the error.

In addition, please explain what you wish to do.

I did some searching on goggle and found that this error
is usually resulted when an asp application is try to
open a message box.

Ravikanth[MVP]
 
The VB MsgBox function can not be used in a web application. It calls a
Windows API to display a Message Box on the machine on which the application
is running. ASP.Net is used to create web applications, where the users of
the applications are nowhere near the machine running the app. They are
looking at an HTML document in a web browser. If you want to pop up a
Message Box on the browser, you have to include JavaScript in your ASP.Net
page that does so on the client browser (something like: alert("Your
message");). To do this in ASP.Net, you would use
Page.RegisterStartupScript() in your CodeBehind. See the following SDK
article for details:

http://msdn.microsoft.com/library/d...-us/dnaspp/html/aspnet-injectclientsidesc.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
Use a label control (normally hidden; generally at top of
page); when needed, change its back color to something
like light yellow, apply appropriate text, and make it
visible.

With a default property of hidden, it is out of sight
until needed.

And no client side script needed.
 
Back
Top