Generating Route Url to MVC controller action from WebAPI. There seems to be a UrlHelper property on the APIController but I cant find any examples of how to use this and have not been able to figure it out myself. UPDATE: The reason I am trying to generate a url is that this particular webapi method sends an email which provides. Using Named Routes¶ Sometimes you’ll find typing out all the URL parameters for a route too verbose, or you’d like to take advantage of the performance improvements that named routes have. When connecting routes you can specifiy a name option, this option can be used in reverse routing to identify the route you want to use.
![Named Named](http://www.scottgu.com/blogposts/mvc2/step11.jpg)
![Generate url for image Generate url for image](/uploads/1/2/5/3/125352891/324794095.png)
Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. Public virtual string RouteUrl (string routeName, System.Web.Routing.RouteValueDictionary routeValues, string protocol, string hostName); abstract member RouteUrl: string. System.Web.Routing.RouteValueDictionary. string. string - stringoverride this.RouteUrl: string.
System.Web.Routing.RouteValueDictionary. string. string - string Public Overridable Function RouteUrl (routeName As String, routeValues As RouteValueDictionary, protocol As String, hostName As String) As String Parameters.