2

Something like this might had worked

<%= Html.RouteLink("", new { controller = "Article", action = "Details", id = A.ArticleID}, new { @class = "image-link" })%>

Except it doesnt like an empty title.

1 Answer 1

4

This could work.

<a href="<%= Url.Action("Article", "Details", new {id = A.ArticleID}) %>">
  <img src="<% //Your image src here %>" />
</a>

Several people (my company included) have dabbled with creating something that does this in a HtmlHelper, but in the end, it seemed best to do it like this.

Sign up to request clarification or add additional context in comments.

Comments

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.