【发布时间】:2014-12-03 16:26:26
【问题描述】:
我想将 CDN 与我的 Bundle 一起使用,但 ASP MVC 不能原生处理 CDN url 的版本。
例如:
public static void RegisterBundles(BundleCollection bundles)
{
bundles.UseCdn = true; //enable CDN support
//add link to jquery on the CDN
var jqueryCdnPath =
"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js";
bundles.Add(new ScriptBundle("~/bundles/jquery",
jqueryCdnPath).Include(
"~/Scripts/jquery-{version}.js"));
}
我不能使用{version} 标签在jqueryCdnPath 内,Framewok 无法知道我想要远程 url 中的本地版本。
有没有办法解决这个限制?如何检索本地版本来构建 CDN url?
【问题讨论】:
标签: asp.net-mvc cdn