Gravatar Control Update
This entry was posted on Tuesday, March 18th, 2008 at 12:08 pm and is filed under ASP.NET, Blogging, C#.Update - 12 June 2008
An updated version of this post, containing full source for the control and explanation is available here.
Original Post
The guys over at Gravatar.com have been hard at work updating their service, and I’ve updated the ASP.NET control I developed to reflect the changes.
The maximum size of Gravatars has now been increased from 80 to 512, so there’s a code change in the Render method:
// if the size property has been specified, and in the range
// 1..512:
try
{
// if it's not in the allowed range, throw an exception:
if (Size < 1 || Size > 512)
throw new ArgumentOutOfRangeException();
}
catch
{
Size = 80;
}
So, a default of 80 will still be used if the value specified is not within the 1 to 512 range, or it is not specified, but allows for a larger size.
The avatar.php URL serving the images now supports abbreviation, but the code in the control has not been changed.

The image shows the Design time view of the control, with the width set at the default value of 80. I’ve checked the control at 512 pixels, but my Gravatar doesn’t look too good expanded out to that size, so I’ve decided to stick at size 80 for the screenshot!









June 11th, 2008 at 12:33 am
Is it possible to use gravatar with visual web developer express editions if yes how do i implement that??
June 12th, 2008 at 1:51 pm
Thanks for asking abhijeet.
To use the control, ensure you’re looking at an aspx page on your website. Then show the toolbox (View->Toolbox from main menu), and then right click on the General header in the toolbox.
From the context menu, select “Choose Items” and browse to the assembly (Freshclickmedia.Web.dll), and click “OK” to add.
You may also be interested to know that I’ve posted another Gravatar post with full source code and instructions and screenshots on adding to the toolbox, as I described in this reply.
Go check out the new post for further details.
Hope this helps.