Yesterday, I came across a forum post, where user was facing problem in integrating web optimization framework with MVC 3. So here in this post we will see how we can integrate asp.net web optimization framework with MVC 3 and ASP.NET 4.0 web form application.
Web optimization framework was introduced with MVC 4 and it is included in default MVC 4 template. But we can use it with MVC 3 and ASP.NET 4.0 web form application as well. This is because web optimization framework is built on top of framework 4.0. So here are the steps to use web optimization framework with ASP.NET 4.0 application.
- Create new ASP.NET 4.0 web form or MVC 3 application
- Add web optimization package by issuing following command in Visual studio package manager console
- Now add following code in global.asax.cs
protected void Application_Start()
Bundle commonBundle = new ScriptBundle("~/bundle/common")
- ASP.NET 4.5 & MVC 4: Revisiting IBundleTransform
- ASP.NET 4.5 & MVC 4 Bundling: Next Approach
Check out this index post on ASP.NET Web Optimization Framework (a.k.a Bundling & Minification) to read other post on same.