I have been using this tag ActionLink().Replace in asp.net mvc 1.0:
<li><%= Html.ActionLink("_place_", "Index", "Home").Replace("_place_", "<div id='homeOff'></div>") %></li>
I upgraded the project to mvc 2.0 and now this .replace() does not work any more. I was looking for equivalent code for this.
@adamjford is correct, it now returns a
MvcHtmlStringinstead of a string which is your proplem.But I’d say that you’re trying to do something that the HtmlHelpers weren’t really designed to do. Which is cool because they’re only there as helpers and writing raw html is fine and encouraged for situations like this.
I’d suggest you try something like this: