title: Why Asp.Net MVC 5 put @Scripts.Render("~/bundles/jquery") at the bottom in _Layout.cshtml?
body: <p>I put <code>&lt;script&gt;</code> blocks which use jQuery in the body of one (and only one) cshtml file which uses the template and they causes error because jQuery is not loaded yet. </p>
  
  <p>What's the point to put the <code>@Scripts.Render("~/bundles/jquery")</code> at the bottom of _Layout.cshtml file? </p>
  
  <p>The bottom of the <code>_Layout.cshtml</code>.</p>
  
  <pre><code>    @RenderBody()
      &lt;hr /&gt;
      &lt;footer&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>The following shows the generated source of the cshtml file. </p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () { /// $ not defined.
          // .....
      });
  &lt;/script&gt;
  
      &lt;hr /&gt;
      &lt;footer&gt;
      &lt;/footer&gt;
  &lt;/div&gt;
  
  &lt;script src="/Scripts/jquery-1.10.2.js"&gt;&lt;/script&gt;
  &lt;script src="/Scripts/bootstrap.js"&gt;&lt;/script&gt;
  </code></pre>