I'm working on ASP.NET MVC4. Client has requirement to load all javascripts and css from other domains like CDN with bundling. I've used System.Web.Optimization.
below is the code.
var bundle = new ScriptBundle("~/bundles/scripts/");
bundle.Orderer = new AsIsBundleOrderer();
bundle.EnableFileExtensionReplacements = false;
bundle.CdnPath = "http://js.cusomdomainname.com";
bundle.Include("~/Scripts/jquery-1.7.1.min.js",
"~/Scripts/jquery.unobtrusive-ajax.min.js",
"~/Scripts/jquery.validate.min.js",
"~/Scripts/jquery.validate.unobtrusive.min.js");
BundleTable.Bundles.UseCdn = true;
BundleTable.EnableOptimizations = true;
BundleTable.Bundles.Add(bundle);
BundleTable.Bundles.IgnoreList.Clear();
on view
@Scripts.Render("~/bundles/scripts/")
But It's is not rendering from another domain.
What could be the problem?