I got a ASP.NET MVC 2.0 Preview 1 app and started to create some areas which contains their own routes.
I want to have a way to overwrite these routes in the main project. I can of course not add a new route with the same name. I can see the RouteTable.Routes.Remove(RouteBase item) but not sure how to use it.
//Need to remove "PostIndex" before adding it again
routes.MapAreaRoute(
"OurAreaNameSpace",
"PostIndex",
"post/index/{currentPage}",
new { controller = "Post", action = "Index", currentPage = "" },
new string[] { "OurAreaNameSpace.Controllers" }
);
Propagation—Route propagation allows a virtual private gateway to automatically propagate routes to the route tables. This means that you don't need to manually enter VPN routes to your route tables. For more information about VPN routing options, see Site-to-Site VPN routing options in the Site-to-Site VPN User Guide.
How do in this?
RouteTable.Routes.Remove(RouteTable.Routes["PostIndex"]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With