title: MVC3 simple form validation
body: <p>I'm new to MVC3, and for the first time I will validate a form.
  I saw some validation samples using jQuery and using Model.IsValid but I don't know if this is my case.</p>
  
  <p>I'm using @Html.TextBox, and @Html.ValidationMessage, I can see I need to place 2 jQuery lines in my document to validate:</p>
  
  <pre><code>&lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And I saw that many people use validation only with jQuery, but I couldn't get how it really works. So, could you please give me a sample validation code for the Razor View with jQuery (if needed) and for Controller? As I'm not using TextBoxFor, I believe I can't use validation only with Datannotations in the Model class.</p>
  
  <p>The form I need to validate:</p>
  
  <pre><code>@Html.TextBox("user", "User:")
  @Html.TextBox("email", "Email:") &lt;!-- with validation of email string --&gt;
  @Html.Password("password")
  @Html.Password("passwordConfirm") &lt;!-- with validation if 2 password strings match --&gt;
  </code></pre>