Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I manually lookup a route in the RouteTable MVC.Net? [duplicate]

I have a String inside the action of one of my controllers that represents a Referring URL. The current request's route data is not what I'm looking for (because it is being called from the script tag inside another view).

I want to find the Action and Controller for the referring Url.

Is there some way can I manually use a string like "/Product/23" to find the controller and action the string as a url would produce?

like image 500
ctrlShiftBryan Avatar asked Feb 09 '11 18:02

ctrlShiftBryan


1 Answers

I blogged about doing this exact thing a couple weeks ago:

Creating a RouteData instance from a URL

like image 92
Scott Avatar answered Oct 07 '22 07:10

Scott