In Global.asax we register routes using:
MapRoute(this System.Web.Routing.RouteCollection routes,
string name,
string url,
object defaults,
string[] namespaces)
Is there a way to retrieve the string url from code? Specifically, I am interested in getting route segments from the urls for registered routes like this:
"customRoutePrefix/{controller}/{action}/{id}"
I need to look up "customRoutePrefix" or the equivalent for any registered routes.
I thought I might be able to use System.Web.Routing.RouteTable.Routes to do this, but I haven't found it in there.
Is this possible / how should I do this?