title: data val required not generated using Client Side Validation
body: <p>I am trying to use Client Side Validation in MVC using data annotations.
  Data val attribute is not generated and client side validation is not working.</p>
  
  <p>My approach is :  </p>
  
  <pre><code>  public partial class User : BaseEntity
      {
          public User()
          {
              this.UserRoles = new List&lt;UserRole&gt;();
          }
  
          public int UserId { get; set; }
          public string FirstName { get; set; }
          public string LastName { get; set; }
  }
  </code></pre>
  
  <p>I am using above class as partial class extension:</p>
  
  <pre><code> [MetadataType(typeof(UserMetaData))]
      public partial class User
      { }
  
      public class UserMetaData
      {
          [Required]
          public string FirstName { get; set; }
          [Required]
          public string LastName { get; set; }
  }
  </code></pre>
  
  <p>Including View :</p>
  
  <pre><code>@using (Html.BeginForm("Add", "user", FormMethod.Post, new { @class = "form-horizontal"}))
  {
      @Html.AntiForgeryToken()
      @Html.ValidationSummary(true)
      @Html.Partial("_UserDetails", Model)
  
      &lt;div class="col-md-12 col-sm-12 col-xs-12"&gt;
          &lt;div class="form-group"&gt;
              &lt;div class="col-md-12 col-sm-12 col-xs-12 pull-left"&gt;
                  &lt;input type="submit" class="btn btn-primary btn_box" value="Add" id="formSubmit" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>_UserDetails Partial View :</p>
  
  <pre><code>&lt;div class="form-group"&gt;
                              &lt;div class="col-md-4 col-sm-12 col-xs-12"&gt;@Html.Label("First Name :", new { @class = "col-sm-12 control-label text-label" })&lt;/div&gt;
                              &lt;div class="col-md-8 col-sm-12 col-xs-12"&gt;@Html.TextBoxFor(m =&gt; m.User.FirstName, new { @class = "form-control input-fild", @id = "firstname" })&lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;div class="col-md-4 col-sm-12 col-xs-12"&gt;@Html.Label("Last Name :", new { @class = "col-sm-12 control-label text-label" })&lt;/div&gt;
                              &lt;div class="col-md-8 col-sm-12 col-xs-12"&gt;@Html.TextBoxFor(m =&gt; m.User.LastName, new { @class = "form-control input-fild", @id = "lastname" })&lt;/div&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>When i run the application and see view source "data val" attribute is not generated on the control as it use to generate in normal [Required] attribute.</p>
  
  <p>Am i missing anything ?
  Thanks. </p>