Parse rendered MVC url to controller name , action name and parameters name
I'm looking a solution how to parse a link in mvc into controller开发者_StackOverflow社区 name, action name, parameters name.
Ex: http://mydomain.com/company/view.aspx?display=1&type=myCompany&id=1.
I'm using IIS version 6.0
It will parse like controller name: company action name:view param name: display=1&type=myCompany&id=1
Thanks in advance.
Phil Haack made a route debugger that does do kind of the same:
http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx
Somewhere in the article there is a link to the source code, so you can just take the parts you need.
精彩评论