Putting HTML inside Html.ActionLink(), plus No Link Text?

Instead of using Html.ActionLink you can render a url via Url.Action

<a href="https://stackoverflow.com/questions/1974980/<%= Url.Action("Index", "Home") %>"><span>Text</span></a>
<a href="https://stackoverflow.com/questions/1974980/@Url.Action("Index", "Home")"><span>Text</span></a>

And to do a blank url you could have

<a href="https://stackoverflow.com/questions/1974980/<%= Url.Action("Index", "Home") %>"></a>
<a href="https://stackoverflow.com/questions/1974980/@Url.Action("Index", "Home")"></a>

Leave a Comment