Skip to content

Instantly share code, notes, and snippets.

@yicone
Created December 4, 2012 08:17
Show Gist options
  • Select an option

  • Save yicone/4201780 to your computer and use it in GitHub Desktop.

Select an option

Save yicone/4201780 to your computer and use it in GitHub Desktop.
blog-ASP.NET MVC 3系列-引入ASP.NET Bundling and Minification机制
// 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