Rod
Rod

Reputation: 15477

image not displaying in mvc project deploy to xp

I am using visual web developer 2010 deploying to xp sp3 iis51. I've setup my wildcard in the configuration. However, my images don't show up because the path is wrong. It is not picking up my virtual directory name.

It shows just fine when I browsing to it locally and this is what my image element looks like:

<img src="../../Content/Images/leftSpot.jpg" alt="see properties" />

I've tried src="~/.." doesn't work.

Upvotes: 0

Views: 311

Answers (2)

suresh
suresh

Reputation: 303

This Works.Tested with my MVC project. Razor Engine.

Upvotes: 0

santiagoIT
santiagoIT

Reputation: 9431

Try the following:

razor:

<img src="@Url.Content("~/Content/Images/leftSpot.jpg")" alt="see properties" />

webforms:

<img src="<%=Url.Content("~/Content/Images/leftSpot.jpg")%>" alt="see properties" />

** EDITED (added webforms answer)

Upvotes: 1

Related Questions