John
John

Reputation: 1912

How do I make a custom ActionLink?

I need to include an image within the <a> tag of an ActionLink. What is the best way to do this?

The final rendered link should look like this,

<a href="/Home/Test"><img src="test.jpg" />Test</a>

Upvotes: 0

Views: 312

Answers (1)

SLaks
SLaks

Reputation: 887215

Like this:

<a href="<%= Url.Action("...")"><img src="test.jpg" alt="test" />Test</a>

Upvotes: 2

Related Questions