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>
2

1 Answer 1

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>
Sign up to request clarification or add additional context in comments.

2 Comments

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.
This would help you for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.