Esempio n. 1
0
        public MvcHtmlString Link([PathReference] string href)
        {
            var tagBuilder = CreateTag(HtmlTag.Link, MvcHtmlString.Empty, new RouteValueDictionary());

            tagBuilder.MergeAttribute(HtmlAttribute.Href.ToStringLower(), href);
            tagBuilder.MergeAttribute(HtmlAttribute.Rel.ToStringLower(), "stylesheet");
            tagBuilder.MergeAttribute(HtmlAttribute.Type.ToStringLower(), WebEnumConvertToString.ToHtmlType(HtmlType.TextCss));

            return(new MvcHtmlString(tagBuilder.ToString()));
        }
Esempio n. 2
0
        static TagBuilder CreateScript(string id, HtmlType type, string src, MvcHtmlString content)
        {
            var routeValueDictionary = new RouteValueDictionary(new { type = WebEnumConvertToString.ToHtmlType(type) });

            if (!string.IsNullOrWhiteSpace(src))
            {
                routeValueDictionary.Merge(new { src });
            }
            if (!string.IsNullOrWhiteSpace(id))
            {
                routeValueDictionary.Merge(new { id });
            }

            return(CreateTag(HtmlTag.Script, content, routeValueDictionary));
        }
Esempio n. 3
0
 public MvcScriptTemplate <TModel> ScriptTemplate <TModel>(string id, HtmlType htmlType = HtmlType.TextMustacheTmpl)
 {
     return(new MvcScriptTemplate <TModel>(this.htmlHelper, id, WebEnumConvertToString.ToHtmlType(htmlType)));
 }