Dynamically adding CSS cuts down page weight?
<p>Ok, this is bizaare and the only shop I've seen do this..granted we only have 2 developers in this shop.  My boss thinks that adding css files individually to pages using a helper method makes our site more efficient because when adding the style references in the Masterpage, then every page gets those styles making the site load slower.</p>

<p>So we have a company.css which is our main styles for stuff that is global like the main buckets such as header, footer, main, etc.</p>

<p>Then he wants me to go into each code-behind of lets say a certain set of pages for one of our features and use a utility method we created to dynamically add the product-related style sheet to those pages.  So for instance lets say we have a Reviews &amp; Ratings feature.  We put all our reviews &amp; ratings related classes and ids in Reviews.css.  Ok great.</p>

<p>So for instance in the .aspx.cs pages Init, we'd put this:</p>

<pre><code>Util.AddStylesheet("Ratings.css");
</code></pre>

<p>Now he wants me to include that stylesheet in the codebehind of those pages where our reviews code touches in .aspx pages.  But says do not put a reference to Reviews.css in the master page.</p>

<p>Am I the only one who questions this method and says what's the point of having a master page then?  I mean really, if you put all your .css references in your master page does the argument of saying that now all pages have all these styles (some not used because they do not relate to that page) add weight to your load time for end users?</p>

<p>I mean common right?  Maybe people do this but I've never seen it and it's a management nightmare cause you have references all over the fing place dynamically adding certain .css pages to subsets of .aspx pages.</p>

<p>To me, even though we are an e-commerce site that receives 1 million hits a month, please, I mean seriously adding stylesheets manually and bypassing just putting them all in a master page just boggles my mind.  Am I the only one who thinks this is nuts and questions his assumption that doing that would make page weight excessive because they would be inheriting all stylesheets, some which would be wasted .css because it doesn't necessarily relate to that particular page?  For me, adding them to the master page is a done deal...simple, maintainable, and who cares.</p>

<p>I can understand page weight with JS, but .css?</p>
