当前位置: 首页>>代码示例>>C#>>正文


C# UrlHelper.Asset方法代码示例

本文整理汇总了C#中System.Web.Mvc.UrlHelper.Asset方法的典型用法代码示例。如果您正苦于以下问题:C# UrlHelper.Asset方法的具体用法?C# UrlHelper.Asset怎么用?C# UrlHelper.Asset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.Mvc.UrlHelper的用法示例。


在下文中一共展示了UrlHelper.Asset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PoweredByCloudCore

        public static MvcHtmlString PoweredByCloudCore(this System.Web.Mvc.HtmlHelper helper, ImageSize imageSize)
        {
            var urlHelper = new System.Web.Mvc.UrlHelper(helper.ViewContext.RequestContext);
            
            string imageSourceUrl = urlHelper.Asset(string.Format("poweredby/{0}.png", imageSize), "CUI");

            return new MvcHtmlString(string.Format("<a href=\"http://www.exclr8.co.za/#cloudcore\" target=\"_blank\"><img style=\"border: 0\" src=\"{0}\" /></a>", imageSourceUrl));
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:8,代码来源:PoweredBy.cs

示例2: PreRequest

        protected override void PreRequest(RequestContext requestContext)
        {
            UrlHelper url = new UrlHelper(requestContext);
            var styles = Styles.Current;
            var scripts = Scripts.Current;
            if (styles != null)
            {
                styles.RegisterStyleLink("plugins:bootstrap", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/bootstrap/css/bootstrap.min.css") });
                styles.RegisterStyleLink("plugins:font-awesome", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/font-awesome/css/font-awesome.min.css") });
                styles.RegisterStyleLink("fonts:style", new StyleLink() { Href = url.Asset(ThemeName + "/fonts/style.css") });
                styles.RegisterStyleLink("css:main", new StyleLink() { Href = url.Asset(ThemeName + "/css/main.css") });
                styles.RegisterStyleLink("css:main-responsive", new StyleLink() { Href = url.Asset(ThemeName + "/css/main-responsive.css") });
                styles.RegisterStyleLink("plugins:select2", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/select2/dist/css/select2.css") });
                styles.RegisterStyleLink("plugins:datepicker", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/datepicker/css/datepicker.css") });
                styles.RegisterStyleLink("plugins:iCheck", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/iCheck/skins/all.css") });
                styles.RegisterStyleLink("plugins:bootstrap-colorpalette", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/bootstrap-colorpalette/css/bootstrap-colorpalette.css") });
                styles.RegisterStyleLink("plugins:perfect-scrollbar", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/perfect-scrollbar/src/perfect-scrollbar.css") });
                styles.RegisterStyleLink("css:theme_light", new StyleLink() { Href = url.Asset(ThemeName + "/css/theme_light.css"), Id = "skin_color" });
                styles.RegisterStyleLink("css:print", new StyleLink() { Href = url.Asset(ThemeName + "/css/print.css"), Media = StyleLinkMedia.Print });

                styles.RegisterStyleLink("plugins:font-awesome-ie7", new StyleLink() { Href = url.Asset(ThemeName + "/plugins/font-awesome/css/font-awesome-ie7.min.css"), Criteria = new IeVersionCriteria(7, IeVersionCriteriaOperator.Eq) });
            }

            //
            if (scripts != null)
            {
                scripts.RegisterScript("plugins:respond", new Script() { Src = url.Asset(ThemeName + "/plugins/respond.min.js"), Criteria = new IeVersionCriteria(9, IeVersionCriteriaOperator.Lt) });
                scripts.RegisterScript("plugins:excanvas", new Script() { Src = url.Asset(ThemeName + "/plugins/excanvas.min.js"), Criteria = new IeVersionCriteria(9, IeVersionCriteriaOperator.Lt) });
                scripts.RegisterScript("plugins:jquery", new Script() { Src = url.Asset(ThemeName + "/plugins/jQuery-lib/1.10.2/jquery.min.js"), Criteria = new IeVersionCriteria(9, IeVersionCriteriaOperator.Lt) });
                scripts.RegisterScript("plugins:jquery", new Script() { Src = url.Asset(ThemeName + "/plugins/jQuery-lib/2.0.3/jquery.min.js"), Criteria = new IeVersionCriteria(9, IeVersionCriteriaOperator.Gte) });
                scripts.RegisterScript("plugins:jquery-ui", new Script() { Src = url.Asset(ThemeName + "/plugins/jquery-ui/jquery-ui-1.10.2.custom.min.js") });
                scripts.RegisterScript("plugins:bootstrap", new Script() { Src = url.Asset(ThemeName + "/plugins/bootstrap/js/bootstrap.min.js") });
                scripts.RegisterScript("plugins:bootstrap-hover-dropdown", new Script() { Src = url.Asset(ThemeName + "/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js") });
                scripts.RegisterScript("plugins:blockUI", new Script() { Src = url.Asset(ThemeName + "/plugins/blockUI/jquery.blockUI.js") });
                scripts.RegisterScript("plugins:perfect-scrollbar:mousewheel", new Script() { Src = url.Asset(ThemeName + "/plugins/perfect-scrollbar/src/jquery.mousewheel.js") });
                scripts.RegisterScript("plugins:perfect-scrollbar", new Script() { Src = url.Asset(ThemeName + "/plugins/perfect-scrollbar/src/perfect-scrollbar.js") });
                scripts.RegisterScript("plugins:less", new Script() { Src = url.Asset(ThemeName + "/plugins/less/less-1.5.0.min.js") });
                scripts.RegisterScript("plugins:jquery-cookie", new Script() { Src = url.Asset(ThemeName + "/plugins/jquery-cookie/jquery.cookie.js") });
                scripts.RegisterScript("plugins:bootstrap-colorpalette", new Script() { Src = url.Asset(ThemeName + "/plugins/bootstrap-colorpalette/js/bootstrap-colorpalette.js") });
                scripts.RegisterScript("plugins:icheck", new Script() { Src = url.Asset(ThemeName + "/plugins/iCheck/jquery.icheck.min.js") });
                scripts.RegisterScript("plugins:datepicker", new Script() { Src = url.Asset(ThemeName + "/plugins/datepicker/js/bootstrap-datepicker.js") });
                scripts.RegisterScript("plugin:autosize", new Script() { Src = url.Asset(ThemeName + "/plugins/autosize/jquery.autosize.min.js") });
                scripts.RegisterScript("plugins:select2", new Script() { Src = url.Asset(ThemeName + "/plugins/select2/dist/js/select2.min.js") });
                scripts.RegisterScript("js:main", new Script() { Src = url.Asset(ThemeName + "/js/main.js") });
                scripts.RegisterScript("js:start", new Script() { Content = "Main.isAjaxSubmitForm=" + IsAjaxSubmitForm.ToString().ToLowerInvariant() });
            }

            base.PreRequest(requestContext);
        }
开发者ID:yangwen27,项目名称:moonlit,代码行数:49,代码来源:ClipOneTheme.cs

示例3: GetPlaceHolderImageUrl

 private static string GetPlaceHolderImageUrl(System.Web.Mvc.HtmlHelper helper)
 {
      var urlHelper = new System.Web.Mvc.UrlHelper(helper.ViewContext.RequestContext);
      return urlHelper.Asset(ImagePlaceHolderName,Area);
 }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:5,代码来源:Image.cs


注:本文中的System.Web.Mvc.UrlHelper.Asset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。