Reputation: 21
@Html.ActionLink("Create New", "Create", null, new { @class = "btn btn- warning fa fa-neuter" })
Upvotes: 1
Views: 6311
Reputation: 1
<a href="@Url.Action("action name", "controller name", new { /*id=item.PrimaryKey */})" class="btn btn-danger btn-sm">
<i class="fa-solid fa-person"></i>
</a>
Upvotes: -1
Reputation: 1
Although I am using this syntax in a List view. You can modify it. Use something like this.
@Html.ActionLink("", "Edit", new { /*id=item.PrimaryKey */ }, new{@class="btn btn-outline-primary btn-def fa fa-pencil"})
pardon me, I haven't used the primary key field here but I will add it later.
Upvotes: 0
Reputation: 3
@Html.ActionLink(" ", "Accept_suggested_company", new { id = item.id }, new { @class = "btn btn-outline-primary btn-def fa fa-save" })
You should only include it inside the class
Upvotes: 0
Reputation: 1509
Html.ActionLink()
doesn't support complex links and have only plain text support.
You should use.
<a href="@Url.Action(...)"><i class="icon-pencil icon-white"></i> </a>
Upvotes: 2