What is the correct way to set up and display a JavaScript alert message in ASP .NET?
<p>I'm completely new to working with JavaScript in ASP .NET so bear with me.</p>

<p>Say I have the following:</p>

<pre><code>protected void btnCreateReplication_Click(object sender, EventArgs e)
{
   try
   {
      doSomething();
   }
   catch (Exception ex)
   {
      //How do I display the error? I know if I were in WinForms, I could just do this:
      MessageBox.Show(ex.Message); 
   }
}
</code></pre>

<p>First question: </p>

<ol>
<li>Should I put all of my JavaScript code in a .js file in my ASP .NET solution?</li>
<li>If so, how do I call an alert message from the .js file?</li>
<li>If not, how do I call an alert message instead of the MessageBox.Show?</li>
</ol>
