Reputation: 1815
I have this foreach loop pulling images from my db :
`@foreach (var item in model)
<tr>
<td>
<img width="50" height="50" src="@Url.Action("GetImage", "Product", new { item.ProductId})"/>
</td>
...`
I tried to wrap it in an 'a' tag but all I get is 404's.
<a href = "~/..."> <img width="".../></a>
Any ideas?
Upvotes: 0
Views: 876
Reputation: 17108
an image with a hyperlink is what I'm trying to achieve. You click the image and you're taken to the edit page.
Okay so suppose you get the image as shown in your question Product.GetImage
and then the edit page is called by Product.Edit
, you can have this:
<a href="@Url.Action("Edit")"><img src="@Url.Action("GetImage","Product")" /></a>
Upvotes: 1