Example #1
0
        /// <summary>
        /// 网站图标链接
        /// </summary>
        /// <param name="helper"></param>
        /// <returns></returns>
        public static MvcHtmlString Icon(this HtmlHelper helper)
        {
            var html = AnyTagExtensions.AnyTag(helper, "link", new
            {
                href = string.Format("{0}/img/common/logo.ico", _config.Root),
                rel  = "shortcut icon",
                type = "image/x-icon"
            });

            return(MvcHtmlString.Create(html));
        }
Example #2
0
        public static MvcHtmlString RenderJs(this HtmlHelper helper, params string[] prams)
        {
            var version = _config.Version;

            if (prams.Length == 0)
            {
                return(MvcHtmlString.Create(""));
            }
            List <string> listPrams = prams.ToList();

            StringBuilder sb = new StringBuilder();

            foreach (var p in listPrams)
            {
                sb.Append(AnyTagExtensions.AnyTag(helper, "script", new
                {
                    src = string.Format("{0}/{1}?v={2}", _config.Root, p, version)
                }
                                                  ));
            }
            return(MvcHtmlString.Create(sb.ToString()));
        }