views:

29

answers:

2

I have a big, fat, legacy ASP.NET WebForms application with big, fat, legacy URLs:

/ViewDocument.aspx?documentId=72143&noRedirect=1&someOtherCrapThatJustSeemsToGoOnForever=AndEver

What is the simplest way to implement pretty URLs in WebForms using ASP.NET 3.5? Is there anything in ASP.NET 4 that will make this easier?

Should I implement URL rewriting using an HttpModule?

A: 

The simplest way would be to use an existing URL rewriting component such as urlrewriting.net. It allows you to specify a regular expression transformation on your URLs in your web.config.

Heinzi
A: 

Yes, you can do with with ASP.NET 4 routing too. Scott Guthrie blogged about this:

http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx

Rup