I’m trying to implement the Ajax helper as per the previous question at ASP.NET MVC Ajax.ActionLink with Image
Using Asp.net MVC 3
When I try to add the class the line return link.Replace(“[rep…. gives and error for the “link.replace” code, saying “System.Web.Mvc.MvcHtmlString’ does not contain a definition for ‘Replace’ “
Can anyone advise on this? I also get the same error if I download the referenced project
Thanks
Mark
Convert it to a regular string and back again :
return new MvcHtmlString(link.ToString().Replace("[replaceme]", builder.ToString(TagRenderMode.SelfClosing)));