if you know how to do that by following way.many programmers at
first find it difficult to implement.one may want to display
default image if gravatar image is not available for the user
email address.let's do it -
public string GetGravatarFullUrl(int size, string emailid)
{
//System.Threading.Thread.Sleep(10000);
string email = emailid;
string hash = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(email.Trim(), "MD5");
hash = hash.Trim().ToLower();
string gravatarUrl = string.Format("http://www.gravatar.com/avatar.php?gravatar_id={0}&rating=G&size=size", hash);
return gravatarUrl;
}
when email supplied as a parameter to the above method, it will return gravatar image
url.but by the following way it is confirmed that local default image will be
displayed if gravatar image not available -
string primaryUrl=GetGravatarFullUrl(60, "This email address is being protected from spambots. You need JavaScript enabled to view it.")
string finalUrl= primaryUrl + "&default=http://domainname.com/images/default_user.png";