I need to have an image instead of clickable text and using MVC helpers. Trying the following in vain, also tried toying with MvcHtmlString.Create() which gives an error:
@Ajax.ActionLink(Url.Content("~/Content/extremepc/rightarrow.png"), "Index", "Store", new { category = Model.category, page = Model.PagingInfo.CurrentPage + 1 },
new AjaxOptions
{
UpdateTargetId = "Everything",
Url = Url.Action("StoreContent", "Store", new { category = Model.category, page = Model.PagingInfo.CurrentPage + 1 })
})
Unfortunately, you have to render the link manually.
This might require a lot of effort with your
Ajaxhelper methods, so you’d be best to wrap it in anAjaxHelperExtension method.See this very similar question for several similar solutions:
Html.ActionLink as a button or an image, not a link
It would be awesome if the
Html.ActionLink(and all other helpers for that matter) would allow thelabelparameter to accept aHtmlString… I’m actually surprised that’s not already the case!However, since the MVC framework is open-source, it actually wouldn’t be too difficult to copy the
AjaxHelpermethods, and modify them to useHtmlStringinstead ofString.