1
Vote

Provide an easy way to get the name of a route for link generation scenarios

description

To use UrlHelper to generate links you need to provide the name of the route you want to use for the link. In some cases I want to use the route that the request came in on. I can get the route instance from the route data on the requests, but there is no easy way for me to get the name of the route.

comments

HongmeiG wrote Jun 7, 2012 at 9:32 PM

We are closing down the current release.

HongmeiG wrote Apr 5 at 6:57 PM

Since you can retrieve the route already from the request, then you can call GetVirtualPath on that route directly. We could add extension method to make it easy.

Request.GetRouteData().Route.GetVirtualPath(Request, routeValues).VirtualPath;

Now it will nice to have our extension method to add the secret “httproute” key so user doesn’t need to.