Clancinio
Clancinio

Reputation: 942

Add favicon to Html.ActionLink in ASP.NET MVC?

I would like to add a "+" icon to my "Create New" button. My code currently displays the plus button outside of the button. I would like it to be inside the button. How can I achieve this?

<p>
    <i class="fa fa-plus"></i> @Html.ActionLink("Create New", "Create", "PositionController", new { @class 
     = "btn btn-success" })
</p>

Upvotes: 0

Views: 178

Answers (1)

Abdul Haseeb
Abdul Haseeb

Reputation: 582

Using anchor tag you can achieve this.

<a href="@Url.Action("actionName", "controllerName")" class="btn btn-success">
    <i class="fa fa-plus"></i>
</a>

Upvotes: 1

Related Questions