943,719 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 9163
  • ASP.NET RSS
Jan 13th, 2007
0

message box

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

MsgBox("<script language='javascript'>successfully saved</script>")

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. :!:

Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
hkarthik is offline Offline
29 posts
since Jan 2007
Jan 14th, 2007
0

Re: message box

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
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Jan 15th, 2007
0

Re: message box

Click to Expand / Collapse  Quote originally posted by hkarthik ...
hi all,
how do we display a messagebox in ASP.net. i tried in this way

MsgBox("<script language='javascript'>successfully saved</script>")

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
khusani is offline Offline
13 posts
since Oct 2006
Sep 12th, 2008
0

Re: message box

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Shubhib is offline Offline
11 posts
since May 2008
Sep 22nd, 2008
0

Re: message box

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
puja_suri is offline Offline
9 posts
since Sep 2008
Sep 29th, 2008
0

Re: message box

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

ASP.NET Syntax (Toggle Plain Text)
  1. Me.Page.RegisterStartupScript("MessageID", "<script>errBody = 'Your Message Body'; errTitle = 'Message Box Title';</script>")

Mohammed Yousuf uddin
Software Developer
Reputation Points: 12
Solved Threads: 38
Junior Poster
reach_yousuf is offline Offline
194 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Play Video (FLV) in a WebPage
Next Thread in ASP.NET Forum Timeline: How do i get to the more details page





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC