Category Archives: ASP.NET

5 things you may not know about ASP.NET

Since its release in early 2002, Microsoft’s ASP.NET platform has gone from strength to strength. Despite its strong uptake from Microsoft-centric software houses, there may be a few people who have hesitated in adopting ASP.NET for their web development platform. Here I present some things you might not know about ASP.NET. Perhaps it’ll encourage you to take a look at it.

Cost

There once was a time when the standard IDE for developing ASP.NET apps, Visual Studio, was prohibitively expensive for the average Joe. In late 2007, Microsoft released its first versions of ‘Express’ software, aimed at students and hobbyists. Though Express incarnations have fewer features than their full version cousins, they do offer the possibility of exploring ASP.NET. The Microsoft website offers a download page for Visual Web Developer 2008 Express Edition. An express version of SQL Server is also available, and can be downloaded from the SQL Server 2008 download page.

MVC Support

The MVC pattern is an established and well-recognised way of building web applications, and is familiar to RoR, Java and PHP developers. For many years, MVC was not available as a standard approach to developing ASP.NET websites, but Microsoft has recognised the deficiency and have (at the time of writing) released version 1.0 Release Candidate of ASP.NET MVC. The release has had a mixed response from the ASP.NET community, many of whom are used to the traditional code-behind model. Despite the inevitable squabbles as to which way is best, many have welcomed the MVC approach for its separation of concerns and finer control over JavaScript and markup. To find out more about the release candidate, head over to Scott Guthrie’s blog post.

Learning Resources

A big advantage for anybody learning a new technology is the wealth of learning material that is available. Although you can rely on a large number of books, the ASP.NET learn website contains many videos on both traditional and MVC ASP.NET as well as data access.

Intrinsic jQuery Support

The lightweight open source JavaScript library that’s taken the web by storm is now fully supported by Microsoft. As well as full intellisense support in Visual Studio, Microsoft will be using the library as-is, without forking or changing the code from the main jQuery branch. What’s more, Microsoft will be using jQuery as a basis for future ASP.NET and ASP.NET AJAX features. I feel this counters the argument of Microsoft not supporting open-source software.

Career Prospects

Microsoft’s ubiquity means that learning ASP.NET and supporting technologies will do no harm to your career prospects. .NET skills are ranked as some of the most in-demand in the UK.

Gravatar Control Update

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.

Design time view of the control

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!

Gravatar ASP.NET Control

Update – 12 June 2008

An updated version of this post, containing full source for the control and explanation is available here.

Original Post

I just got myself a freshclickmedia.com Gravatar over at gravatar.com. A Gravatar is a little avatar associated with an email address, and quite a few blogs use them to decorate post comments. Signing up is easy – all you need to do is supply an email address, and image, and give your image a content rating.

The source of the gravatar image tag points to gravatar.com’s image generator and includes an MD5 hash of the email address to prevent email harvesting. A ‘max rating’ parameter prevents the display of unsavoury content.

There are a wide number of blogging gravatar plugins, so I decided to write an ASP.NET custom control to do the job. Here I present the control and its features.

Continue reading