ASP.NET MVC - absolute URL to content to be determines from outside controller or view
I have some content which is sitting in a path something like this: /Areas/MyUsefulApplication/Content/_awesome_template_bro/Images/MyImage.png Is there a way get a fully qualified absolute URL to that path without being in a controller or view (where url helpers are readily available). You could write an extension method: public static class UrlExtensions { public static Uri GetBaseUrl(this UrlHelper url) { var uri = new Uri( url.RequestContext.HttpContext.Request.Url, url.RequestContext.HttpContext.Request.RawUrl ); var builder = new UriBuilder(uri) { Path = url.RequestContext.HttpContext