0

While testing in visual studio all work good, but when I am deployed in iis it doesn't show image what's the cause of a problem? even when i test it on iis express through WebMatrix it work but not worked in iis.

3
  • Possible duplicate of CSS, Images, JS not loading in IIS Commented Jul 1, 2018 at 7:25
  • Is the folder where your images are stored included in your publish? Commented Jul 1, 2018 at 8:56
  • When deployed under IIS, load the page in browser and then right click on the broken image and click open in new tab and check if image path is correct. Commented Jul 1, 2018 at 20:24

2 Answers 2

1

Make sure that the Static Content feature is installed on the Web Server under the Role Services of IIS ---> Common HTTP Features.

The problem may be that IIS is not serving Static Content, check this link: http://adilmughal.com/blog/2011/11/iis-7-not-loading-css-and-image/

Sign up to request clarification or add additional context in comments.

Comments

0

try this

<img src= "@Url.Content("~/path/img")">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.