This is a complete implementation of the Gravatar image request API, according the Gravatar documentation, as an ASP.Net MVC HtmlHelper.
-
Size
-
Default image (404, mystery-man, identicon, monsterid, wavatar, retro)
-
Custom default image (url)
-
Force default image
-
Ratings
-
Secure requests (HTTPS) is automatic (but can be forced)
-
Drop the single
GravatarHtmlHelper.cs
into your ASP.Net MVC project -
Start using it in your Views:
@Html.GravatarImage("user.name@email.com") @Html.GravatarImage("user.name@email.com", 32, GravatarHtmlHelper.DefaultImage.Identicon, false, GravatarHtmlHelper.Rating.G)
That’s it. No attribution required, but feel free to leave a comment on my blog if you find it useful