Open your ASP.NET application(WebForm or MVC) and install BundleMinifyInlineJsCss nuget package.
Then register the response filter. If you are using WebForm, you can register response filter in a master page and if you are MVC, you can use register response filter in an action filter.
public partial class SiteMaster : System.Web.UI.MasterPage
protected void Page_Load(object sender, EventArgs e)
Response.Filter = new BundleAndMinifyResponseFilter(Response.Filter);
public class BundleMinifyInlineCssJsAttribute : ActionFilterAttribute
public override void OnActionExecuting(ActionExecutingContext filterContext)
filterContext.HttpContext.Response.Filter = new BundleAndMinifyResponseFilter(filterContext.HttpContext.Response.Filter);
public class HomeController : Controller
Now just run your application. If a page view-source is,
After using the above response filter, it will become,