URL Analysis Using ASP.NET MVC Routing

I have a URL in a string format that I want to parse to get relevant route values. I can parse the string manually, but I want to use my routing configuration, so I am not tied to a specific string format (so that I can easily change the format of the URL).

I am trying to use the GetRouteData method for RouteCollection, but this requires the HttpContextBase parameter. Obviously this works fine when the url is the current url, but I need to be able to pass any url.

In my routing modulation tests, I cheat on HttpContextBase, but I don't want to do this in production code!

Any ideas?

+3
source share
1 answer

You will probably find useful information here.

http://forums.asp.net/t/1281667.aspx

+4
source

Source: https://habr.com/ru/post/1722721/


All Articles