title: Don't Render Section in the Layout
body: <p>I use ASP.NET MVC 5 and Empty Project.</p>
  
  <p>I have a Layout and a View. In the Layout I have a <code>RenderSection()</code> and before Rendered check that . And in the View I Add that section but Don't Render Section .</p>
  
  <p>I getting This Error:</p>
  
  <blockquote>
    <p>The following sections have been defined but have not been rendered
    for the layout page "~/Views/_Layout.cshtml": "Menu".</p>
  </blockquote>
  
  <p><strong>My Layout is:</strong></p>
  
  <pre><code>&lt;body&gt;
  &lt;div id="menu"&gt;
      @if(IsSectionDefined("Menu"))
      {
          RenderSection("Menu", required: false);
      }
      else
      {
          &lt;span&gt;this is the default&lt;/span&gt;
      }
  &lt;/div&gt;
  &lt;div id="content"&gt;
      @RenderBody()
  &lt;/div&gt;
  </code></pre>
  
  <p>
  and my view is :</p>
  
  <pre><code> @{
      ViewBag.Title = "Index";
      Layout = "~/Views/_Layout.cshtml";
  }
  
      &lt;h2&gt;Index&lt;/h2&gt;
      @section Menu{
          &lt;ul&gt;
              &lt;li&gt;Item 1&lt;/li&gt;
              &lt;li&gt;Item 2&lt;/li&gt;
              &lt;li&gt;Item 3&lt;/li&gt;
              &lt;li&gt;Item 4&lt;/li&gt;
          &lt;/ul&gt;
      }
  </code></pre>
  
  <p>why does not work?</p>