Created
December 4, 2012 08:17
-
-
Save yicone/4201780 to your computer and use it in GitHub Desktop.
blog-ASP.NET MVC 3系列-引入ASP.NET Bundling and Minification机制
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://stackoverflow.com/questions/13124218/asp-net-mvc-4-use-bundles-beneficts-for-url-content?rq=1 | |
| public static IHtmlString DynamicScriptsBundle( this HtmlHelper htmlHelper, string nombre, params string[] urls) | |
| { | |
| string path = string .Format("~/{0}", nombre); | |
| if (BundleTable.Bundles.GetBundleFor(path) == null) | |
| BundleTable.Bundles.Add(new ScriptBundle(path).Include(urls)); | |
| return Scripts .Render(path); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment