title: Defaulting a section in a Razor view
body: <p>Here's the situation I'm trying to solve:</p>
  
  <p>I have a main shared layout with a single section @RenderSection("Menu") that I want to default to a standard menu for the majority of my pages, but I would like to replace/override that section in a few sub pages. Is this possible with Razor at this stage in the game?</p>
  
  <p>I was hoping I could possibly define the default implementation of that section in _ViewStart.cshtml but it doesn't seem to like it.</p>
  
  <p>Would a Menu Partial view be better for this situation?</p>
  
  <p>Edit:</p>
  
  <p>I'm getting the following error with this code now: The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "menu".</p>
  
  <p><strong>_Layout.cshtml</strong></p>
  
  <pre><code>            &lt;div id="menu"&gt;
  @if (IsSectionDefined("menu"))
  {
      RenderSection("menu");
  }
  else { 
      &lt;text&gt;
              &lt;ul&gt;
                  &lt;li&gt;@Html.ActionLink("Home", "Index", "Home")&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Lookups&lt;/a&gt;
                      &lt;ul&gt;
                          @Html.ActionLink("Product","Index","Product")
                      &lt;/ul&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
      &lt;/text&gt;
  }
          &lt;/div&gt;
  </code></pre>
  
  <p><strong>Index.cshtml</strong></p>
  
  <pre><code>@section menu {
              &lt;ul&gt;
                  &lt;li&gt;@Html.ActionLink("Product", "Index", "Product")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Form Type", "Index", "Product")&lt;/li&gt;
                  &lt;li&gt;@Html.ActionLink("Supplier", "Index", "Product")&lt;/li&gt;
              &lt;/ul&gt;
      }
  </code></pre>