title: Is it possible to make Razor sections optional?
body: <p>If I have a page with:</p>
  
  <pre><code>&lt;body&gt;
      @section SomeStuff {
          &lt;span&gt;This is a section I just addered&lt;/span&gt;
      }
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Is it possible for the layout to <em>not</em> render this section, or is that contrary to how this should work conceptually. Seems like it would be useful to be able to not render certain sections on a page (unless I'm thinking about this incorrectly).</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Including the error message may be helpful, when I put a section into the <em>main</em> page, the <em>layout</em> page fails with: <code>The following sections have been defined but have not been rendered for the layout page "/Views/Layouts/_Layout1.cshtml": "SomeStuff".</code> As if it's forcing me to render every section on the page or something.</p>
  
  <p>In otherwords, in Layout.cshtml, I <em>don't</em> call @RenderSection, but in Index.html I have a section called <code>SomeStuff</code> defined. Is that legal? Seems like it's forcing me to render all sections in the page, but that seems like sections should be optional, no?</p>