tags:

views:

18

answers:

2

Currently, I have code like this :

<% if (consumer.IsDischarged)
    { %>
        <%= Html.ActionLink("<img src=\"../../Images/ConsumerImages/computer_go.png\" alt=\"discharged\" style=\"border:\"0\"/>", "Details", new { id = consumer.ApsId })%>
    <%}
 %>

Basically I want to show the hyperlinked image whenever the status of the isDischarged property of the consumer object is true. Any help or suggestions are highly appreciated.

A: 

a simple way could be

<a href="/Details/<%=consumer.ApsId%>"
<img src="../../Images/ConsumerImages/computer_go.png" alt="discharged" style="border:0"/>
</a>
ajay_whiz
A: 

You can try something like this. Use Url.Action to get the url and then you can put insert the hyperlinked image normally rather than trying to use Html.ActionLink.

<a href="<%= Url.Action("Details", new { id = consumer.ApsId }) %>">
  <img src="../../Images/ConsumerImages/computer_go.png" alt="discharged" style="border:"0" />
</a>
Brandon