Get matching route from url

How do I get the appropriate route for the url (in string format)?

Basically something like ...

Routes.GetMatchingRoute("http://mysite.com/foo/bar/1");

      

Without HttpContext.

Basically, I would like to use RedirectToAction using the reference url.

0


source to share


1 answer


You can just return Redirect (url); instead of RedirectToAction ();

I remember someone asking this before, but I can't seem to find the question.



Edit: here it is (note the OP's edit), there was no answer there either.

+2


source







All Articles