14
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 Styles folder on the site:
Global.asax
BundleTable.Bundles.EnableDefaultBundles();
Site.master
<link rel="stylesheet" type="text/css" href="Styles/css" />
Question: 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 could have their own CSS definitions. Is it possible to include only the site.css file in the master page, and then conditionally add .css files to the bundle as each page requires?
I tried this in the code behind of Default.aspx but it didn't work:
BundleTable.Bundles.Add(new Bundle("~/Styles/Default.css"));