Donate

Add Glyphicon To Html.ActionLink() In ASP.NET MVC

Hello,
Here's how to integrate glyphicon to Html.ActionLink() helper in ASP.NET MVC. The code below will display the glyphicon shopping cart right after the text Checkout of the anchor element.
@Html.ActionLink("Checkout", "Index", "Home", null, new { @class = "btn btn-info glyphicon glyphicon-shopping-cart" })
In order to add the glyphicon before the text of the anchor element, use @Url.Action() instead.
<a href="@Url.Action("Index", "Checkout")" class="btn btn-info">
 <span class="glyphicon glyphicon-shopping-cart" ></span>Checkout
</a>
Output:
Add Glyphicon To Html.ActionLink() In ASP.NET MVC

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.