本文整理汇总了C#中System.Web.Mvc.UrlHelper.StylesBundleUrl方法的典型用法代码示例。如果您正苦于以下问题:C# UrlHelper.StylesBundleUrl方法的具体用法?C# UrlHelper.StylesBundleUrl怎么用?C# UrlHelper.StylesBundleUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.UrlHelper
的用法示例。
在下文中一共展示了UrlHelper.StylesBundleUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Manifest
public ActionResult Manifest()
{
var result = new ManifestResult
{
NetworkResources = new string[] {"*"}
};
result.CacheResources.Add("/favicon.ico");
result.CacheResources.Add("/signalr/hubs");
if (Settings.Default.EnableBundles)
{
var urlHelper = new UrlHelper(Request.RequestContext);
result.CacheResources.Add(urlHelper.StylesBundleUrl().ToString());
result.CacheResources.Add(urlHelper.ScriptsBundleUrl().ToString());
}
if (Settings.Default.EnableCloudfront)
{
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.glyphicons_halflings_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.glyphicons_halflings_white_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.markers_1_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.markers_2_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.markers_3_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.markers_4_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.markers_5_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.markers_location_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.touch_icon_v1_114_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.touch_icon_v1_144_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.touch_icon_v1_57_png);
result.CacheResources.Add(Settings.Default.CloudfrontBaseurl + Links.Content.images.touch_icon_v1_72_png);
}
result.CacheResources.Add("http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js");
result.CacheResources.Add("http://fonts.googleapis.com/css?family=EB+Garamond");
result.CacheResources.Add("http://themes.googleusercontent.com/static/fonts/ebgaramond/v4/kYZt1bJ8UsGAPRGnkXPeFYbN6UDyHWBl620a-IRfuBk.woff");
using (var sha = SHA256.Create())
{
string joined = string.Join("\n", result.CacheResources);
byte[] data = sha.ComputeHash(Encoding.UTF8.GetBytes(joined));
var sb = new StringBuilder();
for (int i = 0; i < data.Length; i++)
sb.Append(data[i].ToString("x2"));
result.Version = sb.ToString();
}
return result;
}