Link to home
Start Free TrialLog in
Avatar of Dinesh Kumar
Dinesh KumarFlag for India

asked on

asp.net bundle and minification question

Hi Experts,

in the below code, I am using bundling feature of asp.net, it works well however I am referring the local files, I want to refer the files from some cdn url, how can I do that. There are total of 2 css files and 2 js files which I want to refer from cdn urls.

public static class BundleConfig
    {
        public static void RegisterBundles(BundleCollection bundles)
        {
            if (bundles != null)
            {
              var CssBundle = new StyleBundle("~/content/StyleBundle").Include(
                    "~/content/bootstrap.css",
                    "~/content/font-awesome.css",
                    "~/content/toastr.css",
                    "~/content/ng-grid.css",
                    "~/content/avb4gjz-d.css",
                    "~/content/tree-control.css",
                    "~/content/tree-control-attribute.css");

var JsBundle = new ScriptBundle("~/scripts/JSBundle").Include(
                    "~/scripts/jquery-{version}.js",
                    "~/scripts/jquery-migrate-1.2.1.js",
                    "~/scripts/fastclick.js",
                    "~/scripts/angular.js",
                    "~/scripts/angular-tree-control.js");

                JsBundle.Transforms.Clear();
		bundles.Add(CssBundle);
                bundles.Add(JsBundle);
              }
           }
      }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mrunal
Mrunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dinesh Kumar

ASKER

I want to directly refer these urls becuase these JS  files keep on updating.

I tried this: http://www.dotnetjalps.com/2014/07/cdn-in-aspnet-mvc-bundling.html

however it did not work.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial