Reputation: 1207
How could I change an action link @Html.ActionLink("Edit", "Edit", new { id=item.id_tache })
to an image. I'm just starting with asp .net mvc. (i want to display an image instead of text)
Upvotes: 0
Views: 914
Reputation: 47784
Here is a small hack
@Html.ActionLink("Button Name", "Index", null, new { @class="classname" })
and then create a class in your stylesheet
a.classname
{
background: url(../Images/image.gif) no-repeat top left;
display: block;
text-indent: -9999px; /* hides the link text */
}
Upvotes: 2
Reputation: 887453
You need to make a regular link:
<a href="@Url.Action(...)"><img src="Url.Content("~/...")" alt="..." /></a>
Upvotes: 3