title: Message Boxes in ASP.NET (MVC) Web Application
body: <p>In a windows form application, I would typically use the code <code>MessageBox.Show("error!")</code> to notify a user of an error for data validation, and I am aware that you can't do this in an asp.net application. After doing some basic research on the problem, I have come to the conclusion that a JQuery dialog box is probably the closest thing to a message box. What are some other alternatives to solve this problem, and is the JQuery dialog box the best way to handle this kind of problem? I am new to software development, mvc and JQuery, I just want to know the best programming practice to handle this problem.</p>
  
  <p>Currently, this is the code I have in my controller:</p>
  
  <pre><code>if (String.IsNullOrEmpty(dateSearchBegin) || String.IsNullOrEmpty(dateSearchEnd))
  {
      //string message = "Both date fields are required";              
  }
  else
  {
     var dtFrom = DateTime.Parse(dateSearchBegin);
     var dtTo = DateTime.Parse(dateSearchEnd);
     return View(db.PurchaseOrders.Where(x =&gt; x.Date &gt;= dtFrom &amp;&amp; x.Date &lt;= dtTo).OrderBy(i =&gt; i.Date).ToPagedList(page ?? 1, 15));
  }
  </code></pre>
  
  <p>I want to put the <code>string message</code> in the validation, how should I combat this problem?</p>