For Example I Want to Create Bundles like this
/*These are my Two separate Bundles*/
bundles.Add(new StyleBundle("~/Content/MYBundle1").Include(
"~/Content/css/style.css"));
bundles.Add(new StyleBundle("~/Content/MYBundle2").Include(
"~/Content/css/media.css"));
/*Now i want to use above two bundles as a single bundle */
bundles.Add(new StyleBundle("~/Content/AllPageBundles").Include(
"~/Content/MYBundle1",
"~/Content/MYBundle2")
Also I want to ask that can i add reference of any file inside a bundle that is physically exist at any site server For Example:I want to add google fonts file inside a bundle like i write bellow
bundles.Add(new StyleBundle("~/Content/MYBundle1").Include(
"http://fonts.googleapis.com/css?family=Open+Sans:300"));
For multi-bundles you can write like:
For directories:
bundles.Add(new Bundle("~/js/core").IncludeDirectory(@"~/Scripts/Infrastructure/JQuery", "*.js")
.IncludeDirectory(@"~/Scripts/Infrastructure/Knockout", "*.js")
.IncludeDirectory(@"~/Scripts/Infrastructure", "*.js"));
For files:
bundles.Add(
new Bundle("~/js/kendo").Include("~/Scripts/kendo/kendo.core.min.js")
.Include("~/Scripts/kendo/kendo.data.min.js")
.Include("~/Scripts/kendo/kendo.binder.min.js")
.Include("~/Scripts/kendo/kendo.calendar.min.js")
For url try this code:
var jqueryCdnPath = "http://fonts.googleapis.com/css?family=Open+Sans:300";
bundles.Add(new ScriptBundle("myfoobundle", jqueryCdnPath).Include("~/Scripts/jquery-{version}.js"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With