2

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.

0

1 Answer 1

12

You can use UrlHelper.Action to generate the url:

<a href="@Url.Action("Index", "Account")">
    <i class="fa fa-dashboard"></i> Dashboard
</a>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.