title: In MVC Razor, how do you do a RenderSection defined below a sub-layout?
body: <p>I have a top-level _Layout.cshtml that looks something like this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      @RenderSection("Header", required: false)
  &lt;/head&gt;
  &lt;body&gt;
  
      @RenderSection("LeftPane", required: false)
      @RenderSection("RightPane", required: false)
      @RenderBody()
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Then I have two "sub-layouts." One defines just the LeftPane section, the other defines both a LeftPane and a RightPane. These sub-layouts are called _LeftPane.cshtml and _LeftPlusRightPane.cshtml, and they have Layout set to "_Layout.cshtml." </p>
  
  <p>Then in each View .cshtml file, I set the Layout to either _LeftPane.cshtml or _LeftPlusRightPane.cshtml, depending on what I want to show up on the page.</p>
  
  <p>That all works fine. The problem is with the new "Header" section I've added in the <code>&lt;head&gt;</code> portion of the document. This section is not defined in the sub-layouts, but rather in the actual Views. When I try to view something this way, I get the error:</p>
  
  <p><strong>The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_LeftPlusRightPane.cshtml": "Header".</strong></p>
  
  <p>I don't want to render the Header section in the sublayouts, I want to render it up in the _Layout.cshtml file. How do I "pass through" the defined Header section from the low level view, through the sub-layouts, up to the top _Layout?</p>