Click here to Skip to main content
14,176,369 members
Rate this:
Please Sign up or sign in to 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.
Updated 26-Feb-19 2:30am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

Image Links in MVC Are Magical (Mostly)[^]
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.190525.1 | Last Updated 26 Feb 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100