title: How to display an error message in an ASP.NET Web Application
body: <p>I have an ASP.NET web application, and I wanted to know how I could display an error message box when an exception is thrown. </p>
  
  <p>For example, </p>
  
  <pre><code>    try
      {
          do something
      }
      catch 
      {
          messagebox.write("error"); 
          //[This isn't the correct syntax, just what I want to achieve]
      }
  </code></pre>
  
  <p>[The message box shows the error]</p>
  
  <p>Thank you</p>
  
  <p><strong>Duplicate of</strong> <a href="https://stackoverflow.com/questions/651592/how-to-display-an-error-message-box-in-a-web-application-asp-net-c/651601">How to display an error message box in a web application asp.net c#</a></p>