title: ASP MVC radio button validation
body: <p>Im new to mvc and have several questions about asp mvc 3 validation, help regarding any of those would be apreciated:</p>
  
  <p>First I have a model class that requires some fields to be present like this:</p>
  
  <pre><code>[Required(ErrorMessage = "Required field")]
  public UInt16 SomeField { get; set; }
  </code></pre>
  
  <p>It's working but the error message is apearing in black font (i want it red), and i think that the validation is taking plance on the server side instead of on the client, i've been reading some tutorials about how to make javascript validation work but it's not working apparently:</p>
  
  <p>Web.config</p>
  
  <pre><code>&lt;appSettings&gt;
    &lt;add key="ClientValidationEneabled" value="true" /&gt;
    &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>Index.cshtml</p>
  
  <pre><code>&lt;script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"&gt;&lt;/script&gt;
  @{ Html.EnableClientValidation(); }
  </code></pre>
  
  <p>That would be my second question, make it work on the client side.</p>
  
  <p>And for some fields that have the <code>Required</code> validator and have a set of radio buttons asociated with them like this</p>
  
  <p>model</p>
  
  <pre><code>[Required(ErrorMessage = "Required field")]
  public UInt16 SomeField { get; set; }
  </code></pre>
  
  <p>view</p>
  
  <pre><code>@Html.RadioButtonFor(model =&gt; model.SomeField, 1) Label
  @Html.RadioButtonFor(model =&gt; model.SomeField, 2) Label
  @Html.ValidationMessageFor(model =&gt; model.SomeField)
  </code></pre>
  
  <p>the validation message is not showing up (even on black font) when you miss to click a radio button, how you can make it show when there are not pressed buttons.</p>
  
  <p>ASP MVC 3
  Razor engine</p>