/// <summary> /// Begins a new tag of any kind. For use in a using statement, allowing other code inside the tag. /// </summary> /// <param name="htmlHelper"></param> /// <param name="tagName"></param> /// <param name="htmlAttributes"></param> /// <returns></returns> public static MvcTag BeginTag(this HtmlHelper htmlHelper, string tagName, IDictionary <string, object> htmlAttributes) { TagBuilder tagBuilder = new TagBuilder(tagName); tagBuilder.MergeAttributes(htmlAttributes); htmlHelper.ViewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.StartTag)); MvcTag theTag = new MvcTag(htmlHelper.ViewContext, tagName); return(theTag); }
/// <summary> /// Begins a new tag of any kind. For use in a using statement, allowing other code inside the tag. /// </summary> /// <param name="htmlHelper"></param> /// <param name="tagName"></param> /// <param name="htmlAttributes"></param> /// <returns></returns> public static MvcTag BeginTag(this HtmlHelper htmlHelper, string tagName, IDictionary<string, object> htmlAttributes) { TagBuilder tagBuilder = new TagBuilder(tagName); tagBuilder.MergeAttributes(htmlAttributes); htmlHelper.ViewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.StartTag)); MvcTag theTag = new MvcTag(htmlHelper.ViewContext, tagName); return theTag; }