Reputation: 2536
Normally, i would write something like this:
<li>@Html.ActionLink("Dashboard", "Index", "Account")</li>
To generate this:
<a href="/Account">Dashboard</a>
What i want to know is whether it is possible to generate the following HTML
<a href="#"><i class="fa fa-dashboard"></i> Dashboard</a>
Without having to create my own custom TagBuilder class.
Thanks for the help.
Upvotes: 2
Views: 2825
Reputation: 13640
You can use UrlHelper.Action to generate the url:
<a href="@Url.Action("Index", "Account")">
<i class="fa fa-dashboard"></i> Dashboard
</a>
Upvotes: 12