Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an ASP.NET MVC HtmlHelper for image links?

The Html.RouteLink() HtmlHelper works great for text links. But what's the best way to link an image?

like image 346
Zack Peterson Avatar asked Mar 23 '09 21:03

Zack Peterson


People also ask

What is MVC HtmlHelper?

What is HTML Helper in ASP.NET MVC 5? HTML Helpers are methods that return a string. Helper class can create HTML controls programmatically. HTML Helpers are used in View to render HTML content. It is not mandatory to use HTML Helper classes for building an ASP.NET MVC application.

What is the purpose of HtmlHelper class?

The HtmlHelper class renders HTML controls in the razor view. It binds the model object to HTML controls to display the value of model properties into those controls and also assigns the value of the controls to the model properties while submitting a web form.


1 Answers

<a href="<%=Url.RouteUrl(...)%>"><img src="..." alt="..." /></a>
like image 116
Zack Peterson Avatar answered Oct 07 '22 00:10

Zack Peterson