Is it possible to use an Ajax.ActionLink method with an HtmlString as the link text and not a string?
The reason for this is that I want to do something like so:
@Ajax.ActionLink("<span style='highlight'>Hello</span> World", ...)
If I try this now, it’ll return the span etc.. on my page. So I need to return it as a HtmlString
EDIT:
Just tried:
public static MvcHtmlString ActionLink(
this AjaxHelper ajaxHelper,
IHtmlString linkText,
string actionName,
Object routeValues,
AjaxOptions ajaxOptions
)
{
return ActionLink(ajaxHelper, linkText, actionName, routeValues, ajaxOptions);
}
And I got a stack overflow exception?
I solved it by using the solution found here: http://forums.asp.net/p/1702210/4518688.aspx/1?Re+Quick+question+about+Ajax+ActionLink+and+span