ActionLink with glyphicon and Button

1

I would like to know how I can do so that this @Html.ActionLink("Edit", "Edit", new { id = item.IDPROJECT}) can format it, I did it this way but it does not work for me:

<a href="@Url.Action("Edit", "Proyectos")" class="btn btn-warning" >Editar
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
 </a>

this is the result I want

    
asked by Daniel 13.12.2017 в 18:17
source

1 answer

2

You can do it in the following way by means of the method ActionLink :

@Html.ActionLink("Editar", "Edit", "Proyectos", new { Id = item.IDPROJECT },
    new { @class = "btn btn-warning glyphicon glyphicon-edit" });

Where the fourth parameter is an object of type IDictionary<string, object> , called htmlAttributes .

    
answered by 13.12.2017 / 18:48
source