开发者

ASP.NET MVC 2 Areas and route priority

开发者 https://www.devze.com 2022-12-17 01:59 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消