开发者

How to parse a url string using mvc2 routes

开发者 https://www.devze.com 2022-12-31 18:44 出处:网络
I\'d like to know if there is a simple way of building a RouteValueDictionary from a url. For exam开发者_JS百科ple if I have a url http://www.site.com/controllerA/actionB/idC, then how can I extract t

I'd like to know if there is a simple way of building a RouteValueDictionary from a url. For exam开发者_JS百科ple if I have a url http://www.site.com/controllerA/actionB/idC, then how can I extract the RouteValueDictionary where the item with the key controller would have the value of controllerA.

Note this isn't for testing so I don't want to use mocking and the solution here does not seem to be working.


It seems this was never an issue addressed by MVC so I have written by own URL parser. Although reflector does help a bit.

0

精彩评论

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