The Html.RouteLink() HtmlHelper works great for text links. But what\'s the best way to link an image?
I don't have enough SO swagger to add a comment, but this is a comment on MiniScalope's comment above:
UrlHelper urlHelper = ((Controller)htmlHelper.ViewContext.Controller).Url;
I would suggest making this an HtmlHelper extension method in itself (and simplify it), for reuse:
private static UrlHelper Url(this HtmlHelper helper)
{
return new UrlHelper(helper.ViewContext.RequestContext);
}