Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MsgBox Function

Status
Not open for further replies.

tjherman

Programmer
Jun 19, 2006
68
US
I'm using Visual Studio 2005 (coding in VB). When I use the MsgBox function, it works fine locally but when I try to run it from the server, I get the following error message:

Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

What do I need to do to be able to put up message boxes that ask for the user to confirm something? Is there just a setting on the server, or can I not use the MsgBox function?
 
this is a web application right?

in this case, you cannot directly call the msgbox class. you have to output VBScript / Javascript in your page...

Known is handfull, Unknown is worldfull
 
If you have a look at the namespace for MsgBox (which calls the MessageBox.Show method) you'll see it is part of the System.Windows.Forms namespace. So, unless you are planning on showing a message box on the server, you'll have to use a client-side language.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Does anyone know of where I can look at some sample code to implement this client-side?
 
As vbKris stated, you need to use vbscript or javascript to implement a pop up window client side. Look up the window.open method in javascript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top