messagebox in ASP.Net

G

Guest

I am getting this error message when I run Aspx form of a Visual Basic .Net Applicatio

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

Line 37: title = "MsgBox Demonstration" ' Define title
Line 38: ' Display message
Line 39: response = MsgBox(msg, style, title
Line 40: If response = MsgBoxResult.Yes Then ' User chose Yes
Line 41: ' Perform some action

and the error message is in line 39

Stack Trace is ------

"[InvalidOperationException: 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.
System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options
System.Windows.Forms.MessageBox.Show(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options
Microsoft.VisualBasic.Interaction.MsgBox(Object Prompt, MsgBoxStyle Buttons, Object Title
WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebForm1.aspx.vb:3
System.EventHandler.Invoke(Object sender, EventArgs e) +
System.Web.UI.Control.OnLoad(EventArgs e
System.Web.UI.Control.LoadRecursive(
System.Web.UI.Page.ProcessRequestMain()

where I should apply this style or specify the ServiceNotificatio
 
F

Fitim Skenderi

You have to remember that ASP.NET is executed on the server and not client.
So you are trying to display a MessageBox at server, and IIS does not allw
you to do that.

To display message box in client machine you need to use client javascript
or vbscript alert command.

Fitim Skenderi


Anoop said:
I am getting this error message when I run Aspx form of a Visual Basic ..Net Application

"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. "
Line 37: title = "MsgBox Demonstration" ' Define title.
Line 38: ' Display message.
Line 39: response = MsgBox(msg, style, title)
Line 40: If response = MsgBoxResult.Yes Then ' User chose Yes.
Line 41: ' Perform some action.

and the error message is in line 39:

Stack Trace is -------

"[InvalidOperationException: 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.]
System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String
text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
System.Windows.Forms.MessageBox.Show(IWin32Window owner, String text,
String caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
 

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

Top