title: MVC Html.ValidationMessageFor is not firing in a partial view
body: <p>The Html.LabelFor works fine, so why not Html.ValidationMessageFor?
  My partial view looks like;</p>
  
  <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;SHP.WebUI.Models.OtherLeaveViewModel&gt;" %&gt;
  &lt;% var unique = DateTime.Now.Ticks.ToString(); %&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
      $(document).ready(function () {
          $('#EmployeeOtherLeave_OtherLeaveDate').datepicker({ dateFormat: 'dd-MM-yy' });
          $('#MorningOnlyFlag').click(function () {
              $('#AfternoonOnlyFlag').attr('checked', false);
          })
          $('#AfternoonOnlyFlag').click(function () {
              $('#MorningOnlyFlag').attr('checked', false);
          })
      });
  
      var options = {
          target: '#frmAddAbsenceOneDay&lt;%= unique %&gt;',
          success: RefershList
      };
  
      $(document).ready(function () {
          $('#frmAddAbsenceOneDay&lt;%= unique %&gt;').ajaxForm(options);
      });
  
  &lt;/script&gt;
  
  &lt;div id="AddAbsenceOnDay&lt;%= unique %&gt;"&gt;
      &lt;% using (Html.BeginForm("AddAbsenceOneDay", "Employee", FormMethod.Post,
             new { id = "frmAddAbsenceOneDay" + unique }))
         { %&gt;
          &lt;%: Html.ValidationSummary(true) %&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Add an absence for a day or half day&lt;/legend&gt;
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;%: Html.LabelFor(model =&gt; model.EmployeeOtherLeave.OtherLeaveId)%&gt;&lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.DropDownListFor(model =&gt; model.EmployeeOtherLeave.OtherLeaveId, Model.LeaveList, "&lt;--Select--&gt;")%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.EmployeeOtherLeave.OtherLeaveId)%&gt;                    
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                  &lt;%: Html.LabelFor(model =&gt; model.EmployeeOtherLeave.OtherLeaveDate)%&gt;                    
                      &lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.EditorFor(model =&gt; model.EmployeeOtherLeave.OtherLeaveDate)%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.EmployeeOtherLeave.OtherLeaveDate)%&gt;                    
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                  &lt;%: Html.LabelFor(model =&gt; model.EmployeeOtherLeave.MorningOnlyFlag)%&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.CheckBoxFor(model =&gt; model.EmployeeOtherLeave.MorningOnlyFlag)%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.EmployeeOtherLeave.MorningOnlyFlag)%&gt;                        
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                  &lt;%: Html.LabelFor(model =&gt; model.EmployeeOtherLeave.AfternoonOnlyFlag)%&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.CheckBoxFor(model =&gt; model.EmployeeOtherLeave.AfternoonOnlyFlag)%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.EmployeeOtherLeave.AfternoonOnlyFlag)%&gt;                     
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
  
              &lt;p&gt;
                  &lt;span style="padding-right:10px;"&gt;&lt;input type="submit" value="Create" /&gt;&lt;/span&gt;&lt;input type="button" value="Close" onclick="closeTab()" /&gt;
              &lt;/p&gt;
          &lt;/fieldset&gt;
      &lt;% } %&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My buddy class looks like;</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using SHP.WebUI.Utility;
  using System.ComponentModel.DataAnnotations;
  using System.Web.Mvc;
  using System.ComponentModel;
  
  namespace SHP.Models
  {
      [MetadataType(typeof(EmployeeOtherLeaf.Metadata))]
      public partial class EmployeeOtherLeaf
      {
          public string OtherLeaveName
          {
              get
              {
                  if (this.OtherLeaf == null || this.OtherLeaf.OtherLeaveName == null)
                      return string.Empty;
                  else
                      return this.OtherLeaf.OtherLeaveName;
              }
          }
          public EmployeeOtherLeaf() { }
  
          #region static methods
  
          #region methods
  
          #region "Buddy class" for validation
          /// &lt;summary&gt;
          /// This "buddy class" provides validation for a class generated from EF
          /// &lt;/summary&gt;
          private sealed class Metadata
          {
              [HiddenInput(DisplayValue = false)]
              public int EmployeeOtherLeaveId { get; set; }
              [HiddenInput(DisplayValue = false)]
              public int EmployeeId { get; set; }
  
              [DisplayName("Leave Type")]
              [UIHint("DropDownList")]
              [Required(ErrorMessage = "Leave Type is required")]
              public int OtherLeaveId { get; set; }
  
              [DisplayName("Date")]
              [DataType(DataType.Date)]
              [Required(ErrorMessage = "Date is required")]
              public DateTime OtherLeaveDate
              {
                  get { return Convert.ToDateTime(this.OtherLeaveDate); }
                  set { this.OtherLeaveDate = Convert.ToDateTime(value); }
              }
  
              [DisplayName("Morning Only")]
              public bool MorningOnlyFlag
              {
                  get { return Convert.ToBoolean(this.MorningOnlyFlag); }
                  set { this.MorningOnlyFlag = Convert.ToBoolean(value); }
              }
  
              [DisplayName("Afternoon Only")]
              public bool AfternoonOnlyFlag
              {
                  get { return Convert.ToBoolean(this.AfternoonOnlyFlag); }
                  set { this.AfternoonOnlyFlag = Convert.ToBoolean(value); }
              }
          }
          #endregion  
      }
  }
  </code></pre>
  
  <p><strong>* ADDED INFO *</strong>
  I have since flattened the model and the new view looks like this;</p>
  
  <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;SHP.Models.EmployeeOtherLeaf&gt;" %&gt;
  &lt;% var unique = DateTime.Now.Ticks.ToString(); %&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
      $(document).ready(function () {
          $('#EmployeeOtherLeave_OtherLeaveDate').datepicker({ dateFormat: 'dd-MM-yy' });
          $('#MorningOnlyFlag').click(function () {
              $('#AfternoonOnlyFlag').attr('checked', false);
          })
          $('#AfternoonOnlyFlag').click(function () {
              $('#MorningOnlyFlag').attr('checked', false);
          })
      });
  
      var options = {
          target: '#frmAddAbsenceOneDay&lt;%= unique %&gt;',
          success: RefershList
      };
  
      $(document).ready(function () {
          $('#frmAddAbsenceOneDay&lt;%= unique %&gt;').ajaxForm(options);
      });
  
  &lt;/script&gt;
  
  &lt;div id="AddAbsenceOnDay&lt;%= unique %&gt;"&gt;
      &lt;%Html.EnableClientValidation(); %&gt;
      &lt;% using (Html.BeginForm("AddAbsenceOneDay", "Employee", FormMethod.Post,
             new { id = "frmAddAbsenceOneDay" + unique }))
         { %&gt;
          &lt;%: Html.ValidationSummary(true) %&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Add an absence for a day or half day&lt;/legend&gt;
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;%: Html.LabelFor(model =&gt; model.OtherLeaveId)%&gt;&lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.DropDownListFor(model =&gt; model.OtherLeaveId, Model.SelectLeaveTypeList, "&lt;--Select--&gt;")%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.OtherLeaveId)%&gt;                    
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                  &lt;%: Html.LabelFor(model =&gt; model.OtherLeaveDate)%&gt;                    
                      &lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.EditorFor(model =&gt; model.OtherLeaveDate)%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.OtherLeaveDate)%&gt;                    
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                  &lt;%: Html.LabelFor(model =&gt; model.MorningOnlyFlag)%&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.CheckBoxFor(model =&gt; model.MorningOnlyFlag)%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.MorningOnlyFlag)%&gt;                        
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                  &lt;%: Html.LabelFor(model =&gt; model.AfternoonOnlyFlag)%&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                  &lt;%: Html.CheckBoxFor(model =&gt; model.AfternoonOnlyFlag)%&gt;
                  &lt;%: Html.ValidationMessageFor(model =&gt; model.AfternoonOnlyFlag)%&gt;                     
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
  
              &lt;p&gt;
                  &lt;span style="padding-right:10px;"&gt;&lt;input type="submit" value="Create" /&gt;&lt;/span&gt;&lt;input type="button" value="Close" onclick="closeTab()" /&gt;
              &lt;/p&gt;
          &lt;/fieldset&gt;
  
      &lt;% } %&gt;
      &lt;/div&gt;
  </code></pre>