When I have access to UrlHelper I can convert an ActionResult to a string (i.e. the actual URL) like this: urlHelper.RouteUrl(actionResult.GetRouteValueDictionary());
How can I do that same from a static method where I don't have access to UrlHelper? Thanks.
Just add a using statement for System.Web.Mvc, and create an instance of the UrlHelper class in your static method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With