title: Nested Razor layouts causing client validation to fail
body: <p><strong>Here's my original create page (no nesting) - Client validation works</strong></p>
  
  <pre><code>@model TennisClub.ViewModels.ClubMember.EditorModel
  @{
      ViewBag.Title = "New Club Member";
      ViewBag.LegendTitle = "Club Member";
  }
  &lt;h2&gt;@ViewBag.Title&lt;/h2&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  @using (Html.BeginForm())
  {
      @Html.ValidationSummary(true, "Errors were found on the form. Please correct all errors and try again.")
      &lt;fieldset&gt;
          &lt;legend&gt;@ViewBag.LegendTitle&lt;/legend&gt;
          @Html.EditorForModel()
          &lt;p&gt;&lt;input type="submit" value="Create" /&gt;&lt;/p&gt;
      &lt;/fieldset&gt;
  }
  &lt;div&gt;@Html.ActionLink("Back to List", "Index")&lt;/div&gt;
  </code></pre>
  
  <p><strong>Here's my new Create page (nested) - Client Validation FAILS</strong></p>
  
  <pre><code>@model TennisClub.ViewModels.ClubMember.EditorModel
  @{
      Layout = "~/Views/Shared/StandardLayouts/Create.cshtml";
      ViewBag.Title = "New Club Member";
      ViewBag.LegendTitle = "Club Member";
  }
  @Html.EditorForModel()
  @if (ViewBag.CanUserAccessRestrictedContent)
  </code></pre>
  
  <p><strong>Here's the layout (StandardLayouts/Create.cshtml) used by the above page</strong></p>
  
  <pre><code>@{
      Layout = "~/Views/Shared/_Layout.cshtml";
  }
  &lt;h2&gt;@ViewBag.Title&lt;/h2&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  @using (Html.BeginForm())
  {
      @Html.ValidationSummary(true, "Errors were found on the form. Please correct all errors and try again.")
      &lt;fieldset&gt;
          &lt;legend&gt;@ViewBag.LegendTitle&lt;/legend&gt;
          @RenderBody()
          &lt;p&gt;&lt;input type="submit" value="Create" /&gt;&lt;/p&gt;
      &lt;/fieldset&gt;
  }
  &lt;div&gt;@Html.ActionLink("Back to List", "Index")&lt;/div&gt;
  </code></pre>
  
  <p><strong>Discussion</strong></p>
  
  <p>As far as I can tell, everything works fine using the nested approach except for client validation. When I look at the page source, the script references are there (validate and validate.unobtrusive), but no validation attributes are showing up in the html. If I don't use nested layouts, both the script references and the validation attributes are there.</p>
  
  <p>I get the same results whether I use the standard attribute-based validation or FluentValidation.</p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li><p>Is there something incorrect about the way I'm doing the layout nesting? It seems to be working fine except for this one issue, but maybe I'm doing things in a non-standard way.</p></li>
  <li><p>Is there a setting in web.config or somewhere else I need to change to get client validation to work for pages that are nested more than one level deep?</p></li>
  <li><p>Is this a bug in ASP.NET MVC that I should report to Microsoft?</p></li>
  </ol>