图像未在IIS 7中显示,如何解决? [英] Images not displaying in IIS 7,How to fix that?

查看:77
本文介绍了图像未在IIS 7中显示,如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在visual studio中创建了一个网站并将其安装在IIS 7中。它运行正常,但图像没有显示。如何解决这个问题。我检查了静态内容。

I have created a website in visual studio and installed it in IIS 7.Its running fine but images not displaying.How to fix this problem.I have checked the static content.

推荐答案

您必须在IIS配置中的MIME选项中添加图像扩展名。
You must add the image extension in MIME option in IIS configuration.


确保Images文件夹存在于正确的路径中。在部署网站时,该网站应包含相应的Images文件夹。如果没有将文件夹复制到已部署的路径。并且还尝试在项目中包含该文件夹以进行自动部署。



确保您使用了正确的路径。不要使用绝对路径,请使用相对路径。检查这个

绝对和相对路径 [ ^ ]
Ensure the Images folder exists in right path. While deploying the website, that site should contain the appropriate Images folder. If not copy the folder to deployed path. And also try to include that folder in your project for automatic deployment.

Ensure you have used right path. Don't use Absolute path, use Relative path. Check this
Absolute and Relative Paths[^]


我们讨论了 TeamViewer 的问题。



我发现样式表里面的图像路径(存在于项目文件夹中)指的是图像文件夹内的图像(存在于图像文件夹内)项目文件夹)。

因此,样式表图像文件夹都出现在项目文件夹内的同一级别。



但路径指的是一个父文件夹中的图像,如下所示...

../ {Some Folder Name} /images/numerous.jpg



更正 images / many.jpg的路径解决了这个问题。
We discussed the issue over TeamViewer.

I found the image paths inside Style Sheet (present inside project folder) are referring to images present inside image folder (present inside the same project folder).
So, both the Style Sheet and image folder are present on same level inside project folder.

But the path was referring to the image present in one parent folder like below...
../{Some Folder Name}/images/numerous.jpg

Correcting the path to images/numerous.jpg resolved the issue.


这篇关于图像未在IIS 7中显示,如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆