/// <summary> /// Gets a link tag of the Gravatar profile for the specified <paramref name="email"/>. /// </summary> /// <param name="htmlHelper">The HtmlHelper object that does the rendering.</param> /// <param name="linkText">The link text to display.</param> /// <param name="email">The email address whose Gravatar profile link should be rendered.</param> /// <param name="htmlAttributes">Additional attributes to include in the rendered tag.</param> /// <returns>An HTML string of the rendered link tag.</returns> public static MvcHtmlString GrofileLink(this HtmlHelper htmlHelper, string linkText, string email, IDictionary <string, string> htmlAttributes) { var href = new Grofile().GetLink(email); var link = "<a href=\"" + href + "\""; if (htmlAttributes != null) { foreach (var kvp in htmlAttributes) { link += " " + kvp.Key + "=\"" + kvp.Value + "\""; } } link += ">" + linkText + "</a>"; return(MvcHtmlString.Create(link)); }
/// <summary> /// Gets a link tag of the Gravatar profile for the specified <paramref name="email"/>. /// </summary> /// <param name="htmlHelper">The HtmlHelper object that does the rendering.</param> /// <param name="linkText">The link text to display.</param> /// <param name="email">The email address whose Gravatar profile link should be rendered.</param> /// <param name="htmlAttributes">Additional attributes to include in the rendered tag.</param> /// <returns>An HTML string of the rendered link tag.</returns> public static MvcHtmlString GrofileLink(this HtmlHelper htmlHelper, string linkText, string email, IDictionary<string, string> htmlAttributes) { var href = new Grofile().GetLink(email); var link = "<a href=\"" + href + "\""; if (htmlAttributes != null) foreach (var kvp in htmlAttributes) link += " " + kvp.Key + "=\"" + kvp.Value + "\""; link += ">" + linkText + "</a>"; return MvcHtmlString.Create(link); }