问题
NET MVC4 with Entity Framework. I am trying Rating control, for that I am using @Url.Action
. Now i have to convert action link to star image button. Please anyone give me an idea to getit.
This is my code:
<a href="@Url.Action("rated/4", "Rating")">Half</a>
<a href="@Url.Action("rated/5", "Rating")">One</a>
<a href="@Url.Action("rated/6", "Rating")">One and Half</a>
<a href="@Url.Action("rated/7", "Rating")">Two</a>
<a href="@Url.Action("rated/8", "Rating")">Two and half</a>
回答1:
You can simply add your image tag before closing </a>
. see code below:
<a href="@Url.Action("rated/4", "Rating")"><img style="border:0;" src="image path" alt="Half"></a>
来源:https://stackoverflow.com/questions/22007291/how-to-make-a-actionlink-as-image-in-asp-net-mvc4-razpr-view