Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, everyone. I am working on mvc vb application and in one of my views I want to show an image like this:

@<img src="Content/Images/Tick-512.png" />


but the output is broken image. Can anyone help me how to use this icon in the proper way?

What I have tried:

I tried a couple of other statements but I didnot succeed to show the image that I want.
Posted
Updated 26-Feb-19 2:30am

1 solution

HTML
<img src="@Url.Content("~/Content/Images/Tick-512.png")" />

Or, if you're using MVC4 or later:
HTML
<img src="~/Content/Images/Tick-512.png" />

Image Links in MVC Are Magical (Mostly)[^]
 
Share this answer
 
Comments
Member 13992723 26-Feb-19 8:58am    
Thank you the first solution helped me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900