I know this has to be a duplicate, but I\'ve been wading through the hordes of information on this and I can\'t get it work.
I\'m trying to get a site working on a clien
You could write a small extension method:
public static class UrlExtensions
{
public static string AbsoluteContent(this UrlHelper url, string contentPath)
{
var requestUrl = url.RequestContext.HttpContext.Request.Url;
return string.Format(
"{0}{1}",
requestUrl.GetLeftPart(UriPartial.Authority),
url.Content(contentPath)
);
}
}
and then:
" />
which will output for example: