I need this sort of redirect to happen in my application:
/car go to show-all-cars.aspx
/car/1234 go to edit-car.aspx
This is my current code in global.asax:
routeCollection.MapPageRoute("car-edit",
"car/{id}",
"~/car-edit.aspx",
true,
new RouteValueDictionary { { "id" } });
routeCollection.MapPageRoute("car-all",
"car",
"~/show-all-cars.aspx",
true);
For some reason, going to /car results in a redirect to car-edit.aspx instead of show-all-cars.aspx as needed.
Any ideas?
Webforms C#.NET 4.0