Windows Message Box usage in Web application

We can use Windows Message Box in Asp.Net Web Application and Web Site.

Steps:

1. Add Reference of System.Windows.Form

2. Add Name Space as System.Windows.Form

3.Use the MessageBox class inside your class directly.

(E.g)


Protected Void Button1_Click(Object Sender,EventArgs e)
{
try
{
//Message Box

MessageBox.Show("Hi This is from Button1 Click");

//Confirm Message Box

if(MessageBox.Show("Hi To confirm","Confirm",MessageBoxButtons.YesNo)==DialogResult.Yes)
{
MessageBox.Show("Hi, You Pressed Yes");
}
else
{
MessageBox.Show("Hi, You Pressed No");
}
}
Catch(Exception exMessage)
{
Response.Write(exMessage.Message);
}
}
---


Enjoy Programming.....!
Karthick.C


Related Articles

Optimizing ASP.NET Web application performance through Bundling and Minification Part-2

In the first article we had seen how Bundling helps us to minimize the number of HTTP requests sent from browser to improve ASP.NET web page performance. Now I am going to cover Minification Part which helps to reduce the size of requested resources to improve ASP.NET web page performance in terms of load time of CSS or JavaScript files(resources).

More articles: Message box Windows application Web application

Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: