Hi Folks,
based upon an answer from this SO post, i'm trying to tweak it a bit so that i don't need to hardcode the route and route params, but instead (if possible) use a strongly typed controller action method:-
string path = RouteTable.Routes.GetVirtualPath(
new RequestContext(HttpContext,
RouteTable.Routes.GetRouteData(HttpContext)),
new RouteValueDictionary(
new
{
controller = "Foo",
action = "Bar"
})).VirtualPath;
The MVC Futures namespace (Microsoft.Web.MVC) has the ability to strongly type an ActionLink ... so i was wondering if this is possible to do something like that, here.
A strongly typed GetVirtualpath ???