I am building web application using vb.net 2008.
when I debug using the common complier it can show the Message box, but when I use IIS server the message box can't be shown and cause error page.
the error page says:
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.
is there any setting need to be done to solve this case?
Thanks,
Use could specify the ServiceNotification
or DefaultDesktopOnly
style, as the error message already told you:
MessageBoxOptions Enumeration
ServiceNotification
The message box is displayed on the active desktop.
The caller is a service notifying the user of an event. The function displays a message box on the current active desktop, even if there is no user logged on to the computer.
DefaultDesktopOnly
The message box is displayed on the active desktop.
This constant is the same as ServiceNotification except that the system displays the message box only on the default desktop of the interactive window station
DefaultDesktopOnly will cause the application that raised the MessageBox to lose focus. The MessageBox that is displayed will not use visual styles. For more information, see Rendering Controls with Visual Styles.
But ask yourself: When you rund a web application, how is going to sit before the server, ready to read and click the MessageBox
? Maybe to want to write such messages to the event- or application log instead.