title: Razor nested Layouts with different style in ASP.NET MVC
body: <p>I our project we are working with different bounded context and I am assign to one area of the domain. </p>
  
  <p>We have <code>_MasterLayout.cshtml</code> that is our default layout in which doesn't implement twitter bootstrap and I have a <code>_SubLayout.chstml</code> in which I implement bootstrap. </p>
  
  <p>The problem is that the style from <code>_MasterLayout</code> was override by the style from the <code>_SubLayout</code>.</p>
  
  <p>Edit: Here is how I render the view.</p>
  
  <p><strong>~/Views/_MasterLayout.cshtml</strong> - no bootstrap implementation</p>
  
  <pre><code>      &lt;!DOCTYPE html&gt;
          &lt;html&gt;
              &lt;head&gt;
                  @RenderSection("styles", false)
              &lt;/head&gt;
              &lt;body&gt;
                  &lt;div class='siteMapMenuItems'&gt;&lt;/div&gt;
                  @RenderSection("SubSection")
                  @RenderBody()
              &lt;/body&gt;
          &lt;/html&gt;
  </code></pre>
  
  <p><strong>~/Views/_SubLayout.cshtml</strong></p>
  
  <pre><code>    @ {
           Layout = "~/Views/_MasterLayout.cshtml";
        }
  
  
      @section styles
      {  
        &lt;link rel="stylesheet" type="text/css" href="@Url.Content("~/Areas/xxx/css/bootstrap.css")" /&gt;
       }
  
      &lt;div&gt;
         @section SubSection {
             &lt;h1&gt;Title&lt;/h1&gt;
         }
      @RenderBody()
      @section ContentSection{
          @RenderSection("ContentSection")
      }
      &lt;/div&gt; 
  </code></pre>
  
  <p><strong>~/Views/Content.cshtml</strong></p>
  
  <pre><code>@ {
       Layout = "~/Views/_SubLayout.cshtml";
    }
  
  &lt;div&gt;
  &lt;p&gt;Main Content&lt;/p&gt;
  @section ContentSection{
      &lt;div&gt;Footer&lt;div&gt;
  }
  &lt;/div&gt; 
  </code></pre>
  
  <p>Is there a way to prevent the <code>_MasterLayout</code> to adopt the bootstrap from the <code>_SubLayout</code>?</p>