1

Instead of looking for a way to provide a route to an action method, I'm looking for the inverse:

how to derive the action method with route params from a URL in MVC?

My usage of this is with Request.UrlReferrer where I'd like to parse that URL into a route so that I can have some 'back to' functionality.

Tito
  • 832
  • 10
  • 24
  • Wouldn't you just use `Redirect(string url);`? In your case `Redirect(Request.UrlReferrer);` – Ashley Medway Feb 16 '15 at 10:56
  • Have you looked at http://stackoverflow.com/questions/1481565/string-url-to-routevaluedictionary – Parthasarathy Feb 16 '15 at 11:07
  • @AshleyMedway The trouble is I need to generate some text for the link based on where that link goes. e.g. 'Back to video games' or 'Back to apples' – Tito Feb 16 '15 at 11:24
  • Try this answer, you will need to modify it a little but should do what you want http://stackoverflow.com/a/1632616/1398425 – Ashley Medway Feb 16 '15 at 11:26

0 Answers0