In my global.ascx I have the routing setup:
routeCollection.MapPageRoute("My Home Page", "myhomepage/{myid}", "~/MyHomePage.aspx");
I use Response.RedirectToRoute() with a parameter to open a page. I identified that in the following cases the redirect will fail:
- The parameter is not given. e.g. Response.RedirectToRoute("My Home Page");
- The parameter as null value. e.g. Response.RedirectToRoute("My Home Page", new {myid = null});
- The parameter as null value. e.g. Response.RedirectToRoute("My Home Page", new {myid = string.empty});
Apparently you MUST give a non-empty value to the parameter.