msgbox

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
 
R

Ravikanth[MVP]

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]
 
K

Kevin Spencer

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.
 
M

Mr Helpfull

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

MsgBox in ASP.NET? 1
MSGBOX PROBLEM 3
MsgBox 2
msgbox 1
MsgBox Error 1
MSGBOX Example 2
Enterprise Logging does nothing on server 5
Window Services XML Export Error 1

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top