razorhtml-helperasp.net-mvc-views

html entity in ActionLink


How can I include html entities in ActionLink. e.g. The case of » below.

<p>@Html.ActionLink("Link Text &raquo;", "Index", new { }, new { @class = "btn btn-warning", @role = "button" })</p>

Solution

  • Use Url.Action instead

    <p><a href=@Url.Action("Index") role="button"><span class="btn btn-warning">Link Text &raquo;</span></a></p>