title: Bundling css and javascript with webforms
body: <p>I'm trying to bundle my css/js-files in my webforms project but it's not working.</p>
  
  <p>This is what I've done:</p>
  
  <ul>
  <li><p>Included System.Web.Optimization via NuGet</p></li>
  <li><p>Added the code below to global.asax.cs in Application_Start</p>
  
  <pre><code>BundleTable.Bundles.Add(new ScriptBundle("~/bundle/js").Include("~/js/mainJS.js"));
  BundleTable.Bundles.Add(new ScriptBundle("~/bundle/css").Include("~/css/mainStyle.min.css"));
  </code></pre></li>
  <li><p>Added this to my masterpage</p>
  
  <pre><code>&lt;%: Scripts.Render("~/js/mainJS.js") %&gt;
  &lt;%: Styles.Render("~/css/mainStyle.min.css") %&gt;
  </code></pre></li>
  </ul>
  
  <p>It renders the references to the css/js-files so the page is working but it's not generating a unique file name and it's not refering to the bundle folder like I expected.</p>
  
  <p>I'm using VS2013 and Framework 4.0.</p>