Well, if you are trying to get the current route, you can do it from inside the controller ....
var completeRoute = this.ControllerContext.RouteData.Route;
var justValue = this.ControllerContext.RouteData.Values["value"]
Let me know if this is what you are after ...
UPDATE:
Ok, I think this should do what you need. You should be able to use this in a static method without passing in any context object.
var httpContext = new HttpContextWrapper(HttpContext.Current);
var requestContext = new RequestContext(httpContext, new RouteData());
var completeRoute = requestContext.RouteData.Route;
var justValue = requestContext.RouteData.Values["value"];
Hope this helps.
source
share