Posts

Showing posts from December, 2013

ASP.NET 4.0 Web forms URL Routing

Hi, while working on a ASP.NET project I saw that URLs of the application were quite large and were not much meaningful to the user. Also they were showing the actual folder structure in the project that I found a bit unsecured. So, here I get the requirement to configure application to accept URL of webpages which are meaningful and short.

To fulfill this requirement I used URL routing feature of ASP.NET. URL routing lets you to configure your application to accept URL which do not point to physical files. Instead of this we can show some semantically meaningful URL to user.

For example -

Initial URL -
http://www.yoursite.com/products.aspx?category=laptop

Using routing you can configure your application render same page using following URL -
http://www.yoursite.com/products/laptop

You can also find that new URL is SEO - friendly and can help in search engine optimization (SEO).


Implementing URL routing in ASP.NET web forms In the implementation part of routing we need to do mapping …