Hi,
This is my bundle code:
using System.Web;
using System.Web.Optimization;
namespace shopnamespace
{
public class BundleConfig
{
// For more information on Bundling, visit https://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundle/js")
.Include("~/Scripts/jquery-1.8.2.min.js",
"~/Scripts/jquery-ui.js",
"~/Scripts/html5.js",
"~/Scripts/Product.js",
"~/Scripts/CommonValidation.js",
"~/Scripts/jquery.unobtrusive-ajax.min.js"));
bundles.Add(new ScriptBundle("~/bundle/footerjs")
.Include("~/Scripts/jquery.fancybox.js",
"~/Scripts/HeaderScrollTop.js"));
bundles.Add(new ScriptBundle("~/bundle/jsdetail")
.Include("~/Scripts/jquery.jcarousel.min.js",
"~/Scripts/jcarousel.responsive.js",
"~/Scripts/jquery.easing.1.3.js",
"~/FlexSlider/js/jquery.flexslider-min.js",
"~/FlexSlider/js/flexslider-tab.min.js",
"~/Scripts/scriptbreaker-multiple-accordion-1.js",
"~/Scripts/validation.js",
"~/Scripts/cloud-zoom.1.0.2.min.js",
"~/Scripts/popupwindow.js"));
bundles.Add(new ScriptBundle("~/bundle/jsraty")
.Include("~/Scripts/owl.carousel.js","~/StarRating/lib/jquery.raty.js"));
bundles.Add(new StyleBundle("~/bundle/css")
.Include("~/Content/style.css",
"~/Content/stylesheet.css",
"~/Content/jquery-ui.css",
"~/Content/easy-responsive-tabs.css",
"~/Content/navbar_techandall.css",
"~/Content/banner.css",
"~/Content/responsive.css",
"~/Content/normalize.css",
"~/Content/category.css",
"~/Content/jquery.fancybox.css",
"~/Content/fancybox.css",
"~/Content/feedbackform.css",
"~/Content/font-awesome/css/font-awesome.min.css"));
bundles.Add(new StyleBundle("~/bundle/cssdetail")
.Include("~/StarRating/lib/jquery.raty.css",
"~/Content/owl.carousel.css",
"~/Content/owl.theme.css"));
BundleTable.EnableOptimizations = true;
}
}
}
Global.asax:
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
//WebApiConfig.Register(GlobalConfiguration.Configuration);
GlobalConfiguration.Configure(WebApiConfig.Register);
//FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
And in view page as:
<link href="<%=clsApplicationSetting.GetURL()+"/bundle/css"%>" rel="stylesheet" />
<script src="<%=clsApplicationSetting.GetURL()+"/bundle/js"%>"></script>