ASP.NET MVC 2 Areas and route priority
Is it possible to set route priority in asp.net mvc 2 using a开发者_Python百科rearegistration? I have a catch all {*pagePath} route which I want to set the lowest priority on.
Yes, you can, however it is only useful for sending things to the back of the stack (which is a good idea for your catch-all).
var route = routes["home_default"];
routes.Remove(route);
routes.Add(route);
I use this on my project with routes and it moves it to the end of the list.
精彩评论