is it possible to include Scripts and Styles in same Bundle ?(asp.net mvc5) -
attempting use css , js files same virtualpath bundle name
1 - possible ? (tried:but failed. cant define same virtual path name both script , style)
2 - it possible builtup scriptandstylebundle included mixed bundle ?
just because wantto use same name both css , js.
//in bundleconfig.cs bundles.add(new scriptbundle("~/bundles/domenu") .include("~/plugins/domenu/files/js/domenu.js") ); bundles.add(new stylebundle("~/bundles/domenu") .include("~/plugins/domenu/files/css/domenu.css") );
//in _partiallayoutmenu.cs @scripts.render("~/bundles/domenu") @styles.render("~/bundles/domenu")
result is:
<!--menu layout--> <script src="/plugins/domenu/files/css/domenu.css"></script> <link href="/plugins/domenu/files/css/domenu.css" rel="stylesheet"/> <!--/menu layout-->
any clue ? or want such useless mind ?(thanks)
i'm using cassette, support feature.
configuration:
bundles.add<scriptbundle>(bundlenames.grid, new[] {"~/scripts/grid.js"}, bundle => bundle.addreference("~/" + bundlenames.base)); bundles.add<stylesheetbundle>(bundlenames.grid, new[] {"~/content/grid.less"});
bundlenames
helper class have constant strings.
reference bundles in views:
@{ bundles.reference(bundlenames.grid); }
as you'd expect, include css , js, in correct order.
i'd mention i've started using cassette before asp.net had bundle management , i'm happy it. didn't find interesting feature asp.net had i'm missing.
Comments
Post a Comment