image not displayed (Relative path of image)

For some reason I can't seem to get the image to display.  In the layout page I have used the following variations for the image.

<img src="/Content/Images/image2.jpg" />
<img src="/../Content/Images/image2.jpg" />
<img src="../Content/Images/image2.jpg" />
<img src="http://" & Request.ServerVariables("MyServer") & Request.ApplicationPath & "/Content/Images/image2.jpg"
<img src="<%= ResolveClientUrl("Content/images/image2.jpg") />

I've even used the absolute path:

<img src="" />

Nothing I do seems to display the image.  looking at the folders of C: it's:


going through IIS:

ServerName\Sites\Default Web Site\SiteName\Content\Images\image2.jpg
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you having this problem with your published site or do you get this when testing your code.
Steve7423Author Commented:
With the published site.  everything works fine on my dev machine.  when I publish to the server that's when it fails.
Can you simply right click on the image and copy the source the browser indicates the image is loading from ?
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Steve7423Author Commented:
opening the site the image doesn't display.  I Right click the image on the main screen and here's the url path:


this is what I have in the _layout cshtml (view).  As you can see I've tried a couple different methods with no luck.

<img src="/Content/Images/image2.jpg" />

@*<img src="http://" & Request.ServerVariables("WebSvr-www1") & Request.ApplicationPath & "/Content/Images/image2.jpg"

<img src="<%= ResolveClientUrl("Content/images/image2.jpg") />*@
Steve7423Author Commented:
I soved it !!

dang ! i was doing it wrong.  This is what it should have been.

<img src="@Url.Content("~/Content/Images/image2.jpg")" />

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve7423Author Commented:
Someone in my office helped me find the solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.