Bundling resources via bundle.config vs BundleConfig.cs in ASP.NET 4.5 WebForms

allgenresaadv

New Member
Regarding ASP.NET 4.5's new System.Web.Optimization / Microsoft.AspNet.Web.Optimization:Can anyone explain the difference in the use of bundling resources using the BundleConfig.cs class file as opposed to the bundle.config xml file?I've seen some articles showing bundling both js and css in BundleConfig.cs, while others showing bundling js in BundleConfig.cs and css in bundle.config.I guess I don't understand #1) why you wouldn't just do them both one particular way for simplicity - and #2) why anyone would prefer to hard-code resources like that in a class file? It seems like a much more dynamic approach to just put them in an xml file that can be changed on-the-fly if necessary.It seems like more articles actually lean toward using BundleConfig.cs than anything else. Is there some particular pro or con that encourages this?Thanks-
 
Back
Top