How to add a span in a htmlhelper?

2

I have this helper

 <li>@Html.ActionLink("Registar", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink"})</li>

I wanted to add this <span class="glyphicon glyphicon-user">

 <li><a href="#"><span class="glyphicon glyphicon-user"></span> Registar</a></li>
    
asked by anonymous 07.05.2018 / 20:38

1 answer

1

This answer from @David in SO suggests using Url.Action instead of ActionLink .

It would look like this:

<li>
    <a href="@Url.Action("Register", "Account")">
        <span class="glyphicon glyphicon-user"/> Registrar
    </a>
</li>

I hope I have helped.

    
07.05.2018 / 20:46