public static Email ( this helper, string email, string text = null ) : System.Web.Mvc.MvcHtmlString | ||
helper | this | |
string | ||
text | string | |
return | System.Web.Mvc.MvcHtmlString |
public static MvcHtmlString Email(this HtmlHelper helper, string email, string text = null)
{
var tag = new TagBuilder("a");
tag.AddCssClass("email");
tag.Attributes.Add("href", "mailto:{0}[email protected]".Fill(email));
tag.SetInnerText(text ?? email);
return MvcHtmlString.Create(tag.ToString(TagRenderMode.Normal));
}