ASP.NET 4.0 Web Form Enhancements (Part 2)

Last week I talked about a couple of enhancements which will be part of the next instalment of ASP.NET, 4.0.  This week I thought I’d write some more on the topic, but focus on some SEO enhancements.

Webform Routing

Now some of you are probably already now about and use this feature in .NET 3.5 which was introduced in SP1, however it requires a bit of work and apparently can have some security issues. For more on that see Phil Haack’s post.  In ASP.NET 4.0 webform routing will have built in support.  The great thing about routing is it can help build SEO/human friendly url’s.  Rather than me try and explain the process, I found Scott Galloway’s post very insightful, and more informing that I could be.

Meta Keywords & Description

Another small enhancement to webforms in ASP.NET 4.0 is the addition of the “Keywords” and “Description” properties to a Page. There has always been the “Title” property so I guess this was a no brainer. These can be set either in the page directive, or from the code.

Page directive implementation example

Code implementation example

protected void Page_Load(object sender, EventArgs e)
{
    Page.Keywords = "Some Keywords";
    Page.Description = "A description";
}

Again having this doesn’t save you hours of work, however it saves you from writing your own code to create dynamic Meta tags for your pages.