title: MVC Html.TextBox (not For) client side validation styling
body: <p>I'm having aesthetic and consistency problems when it comes to client side validation errors in a certain View. The view consists of several (child) partial views and is basically a form using both MVC/Razor's <code>Html.Textbox()</code> and <code>Html.TextBoxFor()</code> in many places. In some of the partial views, I need the inputs not to be strongly typed, hence only <code>TextBox()</code>, and in these instances the validation won't trigger the client side styling of the input-boxes.</p>
  
  <p>I know that the ModelState is not valid and the <code>Html.ValidationSummary()</code> shows the correct error messages from validation-errors triggered by both <code>TextBox()</code>'s and <code>TextBoxFor()</code>'s. However only the <code>TextBoxFor()</code>'s gets the class: "input-validation-error"</p>
  
  <p>Question: How do I turn my <code>TextBox()</code>'s red when an error has fired? (simply put). I figure there's a value or attribute missing that JQuery validation triggers on.</p>
  
  <p><strong>Code:</strong></p>
  
  <p>Works: <code>@Html.TextBoxFor(x =&gt; x.Owner, new { @class = "form-control" })</code></p>
  
  <p>Doesn't: <code>@Html.TextBox(name, Model.Name, new { @class = "form-control" })</code> </p>
  
  <p><strong>HTML output</strong></p>
  
  <p>Works: <code>&lt;input class="input-validation-error form-control" data-val="true" data-val-required="Input is required." id="Owner" name="Owner" type="text" value=""&gt;</code></p>
  
  <p>Doesn't: <code>&lt;input class="form-control" id="Applicants_1__Name" name="Applicants[1].Name" type="text" value=""&gt;</code></p>