954,135 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

message box

hi all,
how do we display a messagebox in ASP.net. i tried in this way

MsgBox("")

but it displays a error message saying

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

can anyone help me out in solving this problem. :!:

hkarthik
Light Poster
29 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

Remember that this code is running on the web server in a process that is not running as the currently logged on (to the server) user. Therefore the process will be running under its own Window Station, and will not be able to interact with the desktop in any way. Consequently, you cannot display a MessageBox on the server without setting the flags to indicate that you want to display it on the currently logged in user's Window Station (effectively the default desktop).

Typically, displaying message boxes on servers is regarded as a very bad thing, as a lot of servers are locked in computer rooms and there is no user to dismiss them. Therefore, are you really sure that you want to do this, or would you really prefer to display a message box on the browser (using client-side JavaScript)?

Source

Paladine
Master Poster
Team Colleague
824 posts since Feb 2003
Reputation Points: 211
Solved Threads: 27
 
hi all, how do we display a messagebox in ASP.net. i tried in this way MsgBox("") but it displays a error message saying " 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. " can anyone help me out in solving this problem. :!:




-------------------------------------------------------

well you can add an attribute to a button in Page_Load so a javascript function is fired to show you the message box:

button.Attributes.Add("onclick","ShowMessage();");

in JavaScript:

function ShowMessage()
{
alert("successfully saved");
}

hope this is what you need.

cheerz

khusani
Newbie Poster
13 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

hi all, can you please guide me about how i can display msg like"Are you sure you to delete? yes/no" in asp.net

Shubhib
Newbie Poster
11 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

if we add the given code in the page_laod event den the msg box will be displayed irrespective of the user input if we actaully want to be proceed as such.So wat will be d soln for d same,display msg box based on the user input.

puja_suri
Newbie Poster
9 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

Showing message at server is not a good idea. u can use javascript like this

Me.Page.RegisterStartupScript("MessageID", "<script>errBody = 'Your Message Body'; errTitle = 'Message Box Title';</script>")


Mohammed Yousuf uddin
Software Developer

reach_yousuf
Junior Poster
195 posts since Sep 2007
Reputation Points: 12
Solved Threads: 38
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You