Asp.net-mvc – Image equivalent of ActionLink in ASP.NET MVC

asp.net-mvcrouting

In ASP.NET MVC is there an equivalent of the Html.ActionLink helper for Img tags?

I have a controller action that outputs a dynamically generated JPEG and I wanted to use the same Lambda expressions to link to it as I do HREFs using ActionLink.

Alternatively, a helper that just gives the URL to a route (again specified using Lambdas) would also be acceptable.

EDIT: I had originally specified that I was using Preview 5, however I see that a Beta has been released. So all-in-all the version number was an unneeded piece of info as I may be upgrading soon 🙂

Best Answer

You can use the URL.Action method

<a href="<%= Url.Action("Create")  %>"><img src="../../Content/Images/add_48.png" /></a>