MessageBox.Show(e.Message) giving an error message

Posted by Manu under C# on 4/14/2009 | Views : 11043 | Status : [Member] | Replies : 2
What should i use to get this code to work

using what ?;

Is there a way of establshing what i should use easily.

MessageBox.Show(e.Message)




Responses

Posted by: Vuyiswamb on: 4/14/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day Manu

In Asp.net You cant use MessageBox unless you import the Classes for Windows in your Application and that will look bad because the Windows messagebox will be displayed at the Bottom , what you can do you can do the Following in Javascript



   Response.Write("<Script> alert('Hello World');</script>");


You use Messagebox for Windows Application like this


try 

{
//blablablablablablablablablablabla
}
catch(SQlException ex)
{
MessageBox.Show(ex.Message);
}


Thank you for Posting at Dotnetfunda

Were are looking Forward for your Reply


Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Manu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 4/14/2009 [Member] Bronze

Up
0
Down
If you are developing the Windows base application using C# you can use MessageBox.Show(...)
You have to add the reference of "System.Windows.Forms".
Then you can add the MessageBox.

I am sorry to say that you can't add the MessageBox directly in Asp.Net apllication. You cannot add the MessageBox control in web applocation.


Manu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response