message box

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2007
Posts: 29
Reputation: hkarthik is an unknown quantity at this point 
Solved Threads: 0
hkarthik hkarthik is offline Offline
Light Poster

message box

 
0
  #1
Jan 13th, 2007
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. :!:

Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 27
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: message box

 
0
  #2
Jan 14th, 2007
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
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: khusani is an unknown quantity at this point 
Solved Threads: 0
khusani khusani is offline Offline
Newbie Poster

Re: message box

 
0
  #3
Jan 15th, 2007
Originally Posted by hkarthik View 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. :!:

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

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
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 11
Reputation: Shubhib is an unknown quantity at this point 
Solved Threads: 0
Shubhib Shubhib is offline Offline
Newbie Poster

Re: message box

 
0
  #4
Sep 12th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 9
Reputation: puja_suri is an unknown quantity at this point 
Solved Threads: 0
puja_suri puja_suri is offline Offline
Newbie Poster

Re: message box

 
0
  #5
Sep 22nd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 66
Reputation: reach_yousuf is an unknown quantity at this point 
Solved Threads: 12
reach_yousuf reach_yousuf is offline Offline
Junior Poster in Training

Re: message box

 
0
  #6
Sep 29th, 2008
Showing message at server is not a good idea. u can use javascript like this

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

Mohammed Yousuf uddin
Software Developer
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC