3

I have a URL in string format that I want to parse to get the relevent Route Values. I could parse the string manually, but I want to use my routing configuration so I am not tied to the particular string format (so I can change the URL format easily).

I am trying to use the GetRouteData method on the RouteCollection, but this takes a HttpContextBase parameter. Obviously this works fine when the URL is the current URL, but I need to be able to pass in any URL.

In my routing unit tests I mock HttpContextBase out, but I don't want to do that in production code!

Any ideas?

1 Answer 1

4

Probably you find useful info here

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

Sign up to request clarification or add additional context in comments.

1 Comment

I did end up overriding HttpContextBase in the same way that is suggested in that forum thread.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.