oclockvn
5/19/2019 - 3:12 PM

An typical ASP.NET MVC bundle class

An typical ASP.NET MVC bundle class

using System.Web.Optimization;

namespace YourNameSpace
{
    public class BundleConfig
    {
        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
            //Scripts
            bundles.Add(new ScriptBundle("~/bundles/js").Include(
                "~/path/to/your/jquery.js",
                "~/path/to/your/bootstrap.min.js",
                // add many here
                "~/path/to/your/app.js"
                ));

            //CSS
            bundles.Add(new StyleBundle("~/bundles/styles").Include(
                "~/path/to/bootstrap.css",
                // many here
                "~/path/to/styles.css"
                ));
        }
    }
}