title: MVC ValidationMessageFor not working properly
body: <p>I have the following in my view:</p>
  
  <pre><code>     &lt;fieldset&gt;
          &lt;legend&gt;User Registration&lt;/legend&gt;            
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(m =&gt; m.UsrName)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.TextBoxFor(m =&gt; m.UsrName)
              @Html.ValidationMessageFor(m =&gt; m.UsrName)
          &lt;/div&gt;
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(m =&gt; m.Pwd)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.PasswordFor(m =&gt; m.Pwd)
              @Html.ValidationMessageFor(m =&gt; m.Pwd)
          &lt;/div&gt;
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(m =&gt; m.ReEnterPwd)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.PasswordFor(m =&gt; m.ReEnterPwd)
              @Html.ValidationMessageFor(m =&gt; m.ReEnterPwd)
          &lt;/div&gt;            
         &lt;fieldset&gt;
           &lt;legend&gt;Location&lt;/legend&gt;
             &lt;span id="locationDiv"&gt; 
             @Html.RadioButtonFor(m =&gt; m.Location, "Loc1")  @Html.Label("Loc1")
             &amp;nbsp;&amp;nbsp; 
             &lt;/span&gt;
             @Html.RadioButtonFor(m =&gt; m.Location, "Loc2") @Html.Label("Loc2")               
             @Html.ValidationMessageFor(m =&gt; m.Location)
          &lt;/fieldset&gt;         
  
           &lt;fieldset&gt;
           &lt;legend&gt;Role&lt;/legend&gt;
              @Html.RadioButtonFor(m =&gt; m.Role, "User") @Html.Label("User")
             &amp;nbsp;&amp;nbsp; @Html.RadioButtonFor(m =&gt; m.Role, "Admin") @Html.Label("Admin")
              @Html.ValidationMessageFor(m =&gt; m.Role)
           &lt;/fieldset&gt;  
  
          &lt;p&gt;
              &lt;input type="submit" value="Register User" /&gt;
          &lt;/p&gt; 
      &lt;/fieldset&gt;
  </code></pre>
  
  <p>Even if I don't have all the fields filled, it still goes to the controller even though they are all required. I thought </p>
  
  <pre><code>    @Html.ValidationMessageFor
  </code></pre>
  
  <p>was supposed to prevent that.</p>
  
  <pre><code>    [Required]
      public string Location { get; set; }
  
      [Required]
      public string Role { get; set; }
  
      [Required]
      [Display(Name = "User Name")]
      public string UsrName { get; set; }
  
      [Required]
      [StringLength(50, MinimumLength = 5, ErrorMessage = "Must have a minimum length of 5.")]
      public string Pwd { get; set; }
  
      [Required]
      [Display(Name = "Re-enter Password")]
      [StringLength(50, MinimumLength = 5, ErrorMessage = "Must have a minimum length of 5.")]
      [Compare("Pwd", ErrorMessage = "The password and re-entered password do not match.")]
      public string ReEnterPwd { get; set; }
  </code></pre>