O'Reilly logo

Pro ASP.NET MVC 2 Framework by Steven Sanderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. URLs and Routing

Before ASP.NET MVC, the core assumption of routing in ASP.NET (just like in many other web application platforms) was that URLs correspond directly to files on the server's hard disk. The server executes and serves the page or file corresponding to the incoming URL. Table 8-1 gives an example.

Table 8-1. How URLs Have Traditionally Corresponded to Files on Disk

Incoming URL

Might Correspond To

http://mysite.com/default.aspx

e:\webroot\default.aspx

http://mysite.com/admin/login.aspx

e:\webroot\admin\login.aspx

http://mysite.com/articles/AnnualReview

File not found! Send error 404.

This strictly enforced correspondence is easy to understand, but it's also very limiting. Why should my project's file names and directory structure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required