title: Visual Studio 2012 Conditional Bundling
body: <p>I just began working with VS 2012 RC. I've created a test site with a master page and a single web form. Currently, I'm using this code to bundle the entire <code>Styles</code> folder on the site:</p>
  
  <p><strong>Global.asax</strong></p>
  
  <pre><code>BundleTable.Bundles.EnableDefaultBundles();
  </code></pre>
  
  <p><strong>Site.master</strong></p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="Styles/css" /&gt;
  </code></pre>
  
  <p><strong>Question:</strong> The test site has a site-level CSS file that controls the overall look and feel of the site. In addition to the site-level CSS, each page <em>could</em> have their own CSS definitions. Is it possible to include only the <code>site.css</code> file in the master page, and then conditionally add .css files to the bundle as each page requires?</p>
  
  <p>I tried this in the code behind of <code>Default.aspx</code> but it didn't work:</p>
  
  <pre><code>BundleTable.Bundles.Add(new Bundle("~/Styles/Default.css"));
  </code></pre>