hi..
pls anyone send me coding for MessageBox in default.aspx.cs
i used
messagebox.show(message); but its not working...
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Dec 3, 2010, 7:01 AM EST
Did you read the whole thread post.
Jean PaulRank #32 · 38.5K reputationPosted Nov 30, 2010, 4:14 AM EST
For ASP.NET you can use javascript message boxes using alert()
You can refer code: http://msdn.microsoft.com/en-us/library/aa479011.aspx
Suthish NairRank #92 · 22.8K reputationPosted Nov 30, 2010, 4:28 AM EST
protected void Page_Load(object sender, EventArgs e) { ShowAlert("Hello, Testing"); } public void ShowAlert(string sMsg) { string sStr = "alert('" + sMsg + "');"; this.ClientScript.RegisterStartupScript(this.GetType(), "TEST", sStr); sStr = ""; }CrishRank #1,487 · 1.1K reputationPosted Dec 1, 2010, 9:11 PM EST
Actually ASP.NET has a class that allows use of the message box.
that class is System.Windows.Forms
if you import that into your web form or whatever, you can use this to display a message box:
MessageBox.Show("YourMessageHere","YourBoxTitleHere",MessageBoxButtons.YourChoiceOfButtonsHere,MessageBoxIcon.YourChoiceOfIconHere);
The last 3 parameters are optional, but recommended.
Hope that helps ya out.
Suthish NairRank #92 · 22.8K reputationPosted Dec 1, 2010, 10:01 PM EST
The namespace itself saying System.Windows.Forms.
This will not work for Web applications when you hosted on server. You can test it by yourself.
Jean,
Problem resolved?
Jean PaulRank #32 · 38.5K reputationPosted Dec 1, 2010, 10:23 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Dec 1, 2010, 11:50 PM EST
If this post helped you, then tick the checkbox above "Do you like this Answer"
Rahul Goyal52 reputationPosted Dec 2, 2010, 6:51 PM EST