I'm a firm believer that changing the routes should under no circumstances break the application. The app should even work with no routes (as described below, see the comments). you should be able to develop the app without knowing or caring about the routes. i could go on but i think you get the idea.
I've written the following example which shows all the URL related bugs I've found so far. 5 in total.
Create a default MVC Application and add the following to Site.Master, inside the menu <div>
---
<!--
All of these links will break if "page = 1" is added to the Defaults of "[controller]/[action]/[id]"
See topic - http://forums.asp.net/t/1197234.aspx
-->
<ul>
<li><%= Html.ActionLink( "Home", "Index", "Home" ) %></li>
<li><%= Html.ActionLink( "About Us", "About", "Home" ) %></li>
<li><%= Html.ActionLink( "List Products", new { Action = "List", Controller = "Product" } ) %></li>
<li><%= Html.ActionLink( "Edit Product", new { Action = "Edit", Controller = "Product", Id = 1 } ) %></li>
<!--
The following link does not work because "category" is not mapped in the Route.
This SHOULD generate /Product/ListByCategory?category=3
This would allow the Routes to change and all the links would still work.
You could also have NO ROUTES and it would still work, i.e. /?controller=A&action=B&category=C
-->
<li><i><%= Html.ActionLink( "List Products", new { Action = "ListByCategory", Controller = "Product", category = 3 } ) %></i></li>
<!--
The following doesn't work because "id" is "special"
If your route was "[controller]/[action]/[blah]" then both /a/b/c AND /a/b?blah=c would work identically.
The only reason I can see for this difference in behaviour is that "id" is special. (unless i'm doing something wrong)
-->
<li><i><a href="/Product/EditProduct?Id=5">Edit Product</a></i></li>
<!--
The following link does not work because the first parameter to ListByCategory is not called "Id"
This SHOULD generate /Product/ListByCategory?category=5
See Bug 1 - http://forums.asp.net/t/1197244.aspx
-->
<li><i><%= Html.ActionLink<ProductController>( x => x.ListByCategory( 5 ), "List Products" )%></i></li>
<!--
The following link works UNLESS you are already at /Product/EditProduct/[id]
It will generate /Product/EditProduct/[id]/1
See Bug 2 - http://forums.asp.net/t/1197244.aspx
-->
<li><i><%= Html.ActionLink<ProductController>( x => x.EditProduct( 1 ), "Edit Product" )%></i></li>
</ul>
---
Add the following controller (As you can see we don't care about the actual Views, it's all about the URL resolution.)
---
public class ProductController : Controller
{
[ControllerAction]
public void Index()
{
RenderView( "Index" );
}
[ControllerAction]
public void List()
{
RenderView( "Index" );
}
[ControllerAction]
public void ListByCategory(int category)
{
RenderView( "Index" );
}
[ControllerAction]
public void Edit()
{
RenderView( "Index" );
}
[ControllerAction]
public void EditProduct(int Id)
{
RenderView( "Index" );
}
}
---
Read the comments for a description of each bug.
[edited by: tgmdbm at 11:52 AM on Tue, Dec 25 2007]
The 3rd bug, regarding "id" being "special". I WAS doing something wrong. ?blah=c was working because i had a non-null default on blah. I'm not sure i consider this a bug now.