title: MVC Razor Shared Layout Page Rendering Issue
body: <p>I have an MVC 5 App which uses Razor and a Shared_Layout File.  They Layout file works fine and includes my menu's.</p>
  
  <p>The problem I have is when I try to use it in combination with a page used dhtmlxgannt jquery scripts.  When I comment out the shared Layout, the page renders as I expect but I get no menu's at the top of my page.  When I leave the shared layout in the file, my page does not render the gannt chart is seems to shrink into a small container and all i can see is a horizontal scroll bar.</p>
  
  <p><strong>Shared Layout</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;title&gt;@ViewBag.Title - Mojito&lt;/title&gt;
      @Styles.Render("~/Content/css")
      @Scripts.Render("~/bundles/modernizr")
  
      &lt;style type="text/css"&gt;
          html, body {
              height: 100%;
              padding: 0px;
              margin: 40px;
              overflow: hidden;
          }
      &lt;/style&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="navbar navbar-inverse navbar-fixed-top"&gt;
          &lt;div class="container"&gt;
              &lt;div class="navbar-header"&gt;
                  &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;/button&gt;
  
                  &lt;div class="navbar-collapse collapse"&gt;
                      &lt;ul class="nav navbar-nav"&gt;
                          &lt;li&gt;@Html.ActionLink("Mojito", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })&lt;/li&gt;
                          &lt;li&gt;@Html.ActionLink("Home", "Index", "Home")&lt;/li&gt;
                          &lt;li&gt;@Html.ActionLink("About", "About", "Home")&lt;/li&gt;
                          &lt;li&gt;@Html.ActionLink("Contact", "Contact", "Home")&lt;/li&gt;
  
                      &lt;/ul&gt;
                      @if (HttpContext.Current.User.Identity.IsAuthenticated)
                      {
                          &lt;ul class="nav navbar-nav"&gt;
                              &lt;li&gt;@Html.ActionLink("Customers", "Index", "Customers", new { area = "Customers" }, null)&lt;/li&gt;
  
                              &lt;li class="dropdown"&gt;
                                  &lt;a class="dropdown-toggle" data-toggle="dropdown" href="#"&gt;Projects&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                                  &lt;ul class="dropdown-menu"&gt;
                                      &lt;li&gt;@Html.ActionLink("Projects", "Index", "ProjectTasks", new { area = "Project" }, null)&lt;/li&gt;
                                      &lt;li&gt;@Html.ActionLink("Gannt Chart", "Gannt", "ProjectTasks", new { area = "Project" }, null)&lt;/li&gt;
                                      &lt;li&gt;@Html.ActionLink("Gannt Chart", "Index", "GanttTasks", new { area = "Project" }, null)&lt;/li&gt;
                                  &lt;/ul&gt;
                              &lt;/li&gt;
                              &lt;li class="dropdown"&gt;
                                  &lt;a class="dropdown-toggle" data-toggle="dropdown" href="#"&gt;Kronos&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                                  &lt;ul class="dropdown-menu"&gt;
                                      &lt;li&gt;@Html.ActionLink("Pay Codes", "Index", "KronosPayCodes", new { area = "Kronos" }, null)&lt;/li&gt;
                                      &lt;li&gt;@Html.ActionLink("Import From Excel", "Index", "KronosImportData", new { area = "Kronos" }, null)&lt;/li&gt;
                                      &lt;li&gt;@Html.ActionLink("Import From Xml", "Index", "KronosXmlConfiguration", new { area = "Kronos" }, null)&lt;/li&gt;
                                      &lt;li&gt;@Html.ActionLink("Create Design Document", "Index", "KronosDesignDocument", new { area = "Kronos" }, null)&lt;/li&gt;
                                  &lt;/ul&gt;
                              &lt;/li&gt;
                          &lt;/ul&gt;
                      }
                      @Html.Partial("_LoginPartial")
  
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="container body-content"&gt;
          @RenderBody()
          &lt;hr /&gt;
          &lt;footer&gt;
              &lt;p&gt;&amp;copy; @DateTime.Now.Year - Mojito&lt;/p&gt;
          &lt;/footer&gt;
      &lt;/div&gt;
  
      @Scripts.Render("~/bundles/jquery")
      @Scripts.Render("~/bundles/bootstrap")
      @RenderSection("scripts", required: false)
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Gannt Chart View</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  @model IEnumerable&lt;Mojito.Domain.Entities.GanttTask&gt;
  @{
      ViewBag.Title = "Index";
      //Layout = "~/Views/Shared/_Layout.cshtml";
  }
  
  
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src="~/Scripts/dhtmlxgantt/dhtmlxgantt.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="~/Content/dhtmlxgantt/dhtmlxgantt.css" type="text/css" /&gt;
      &lt;script type="text/javascript" src="~/Scripts/Dhtmlxgannt/CodeBase/testdata.js"&gt;&lt;/script&gt;
      &lt;style type="text/css"&gt;
          html, body {
              height: 100%;
              padding: 0px;
              margin: 40px;
              overflow: hidden}
      &lt;/style&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
     &lt;div id="ganntcontainer" style="width: 100%; height: 100%;"&gt;
          &lt;script type="text/javascript"&gt;
  
      dhtmlx.message("Try to move or resize task to not working time");
  
      gantt.config.work_time = true;
      gantt.config.correct_work_time = true;
  
      gantt.config.scale_unit = "day";
      gantt.config.date_scale = "%D, %d";
      gantt.config.min_column_width = 60;
      gantt.config.duration_unit = "day";
      gantt.config.scale_height = 20 * 3;
      gantt.config.row_height = 30;
  
  
  
      var weekScaleTemplate = function (date) {
          var dateToStr = gantt.date.date_to_str("%d %M");
          var weekNum = gantt.date.date_to_str("(week %W)");
          var endDate = gantt.date.add(gantt.date.add(date, 1, "week"), -1, "day");
          return dateToStr(date) + " - " + dateToStr(endDate) + " " + weekNum(date);
      };
  
      gantt.config.subscales = [
          { unit: "month", step: 1, date: "%F, %Y" },
          { unit: "week", step: 1, template: weekScaleTemplate }
  
      ];
  
      gantt.templates.task_cell_class = function (task, date) {
          if (!gantt.isWorkTime(date))
              return "week_end";
          return "";
      };
  
      gantt.init("ganntcontainer");
      gantt.parse(demo_tasks);
          &lt;/script&gt;
  
      &lt;/div&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>