标签:style blog http color os io ar div cti
public static void Image(this HtmlHelper helper, string src, string alt = null, object htmlAttributes = null) { System.Web.UI.HtmlTextWriter writer = new HtmlTextWriter(helper.ViewContext.HttpContext.Response.Output); System.Web.Mvc.TagBuilder tbImage = new TagBuilder("img"); tbImage.MergeAttribute("src", src); tbImage.MergeAttribute("alt", alt); if (htmlAttributes != null) { tbImage.MergeAttributes<string, object>(new RouteValueDictionary(htmlAttributes)); } writer.InnerWriter.Write(tbImage.ToString(TagRenderMode.SelfClosing)); }
标签:style blog http color os io ar div cti
原文地址:http://www.cnblogs.com/freeliver54/p/3964536.html