Tuesday, 8 January 2013

ASP.NET webforms URL routing


URL routing is very cool functionality available for ASP.NET applications. It allows us to make the application URLs more user friendly. That was not the root key why I decided to use it in our application.

Application renders the PDF files on output dynamically from images in database and show it to users. They can see it in browser in Adobe Reader. There is one functionality in Adobe Reader which allows to send PDF file by email, using email client on the computer. From some version the attachment started to have aspx extension which forces user to rename it before it can be actually opened.

Simple solution to this is to use URL routing functionality to render the file to output as if it is really PDF.

Below are few links which I found useful during implementation and deployment of the application.


Routing with ASP.NET Web Forms
URL routing is not working in IIS 6
Troubleshooting ASP.NET routing on IIS 7