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>
Amirhossein Mehrvarzi
  • 11,037
  • 6
  • 38
  • 65
Vetri
  • 337
  • 2
  • 6
  • 22

1 Answers1

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>
Rajesh Dhiman
  • 1,888
  • 16
  • 29
  • 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. – Vetri Feb 25 '14 at 07:32
  • [This](http://stackoverflow.com/questions/6278694/url-action-parameters) would help you for that. – Rajesh Dhiman Feb 25 '14 at 08:06