How to make a actionlink as Image in Asp.Net MVC4 Razpr View?
Asked Answered
R

1

0

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>
Reconstitute answered 25/2, 2014 at 7:22 Comment(2)
You should be using routeValues to pass your rating value.Samellasameness
You can try into JS : #21847362Dividers
G
8

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>
Glean answered 25/2, 2014 at 7:27 Comment(2)
Yeah I already tried it. But while passing the rated value from view to controller, the value is taken as 4 for the all rating. I mean it's taking first line of rating id. Please help me to solve this problem.Reconstitute
This would help you for that.Glean

© 2022 - 2024 — McMap. All rights reserved.