图片没有显示在发布的ASP.NET MVC网站 [英] Images not showing on published ASP.NET MVC Website

查看:235
本文介绍了图片没有显示在发布的ASP.NET MVC网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  形象不是ASP.NET MVC 展示

我已经问过这个,但没有收到答案固定它。我再次问,因为我已经尝试了所有我能想到的是绝对坚持。我的previous问题在这里:在CSS 图片不显示在ASP.NET MVC

I have already asked this but didn't receive an answer that fixed it. I'm asking again because I have tried everything I can think of and am absolutely stuck. My previous question was here: Images in CSS not showing in ASP.NET MVC

我有在〜/图像/目录图像的ASP.NET MVC应用程序。当我在开发运行,图像显示细腻。出版时,它们不会显示在所有。我不认为这是一个参考路径的问题,因为我已经试过../,./〜/的每个组合,等等。我能想到的。无论是CSS引用,< IMG> < ASP:图像> 标签工作,都有同样的问题。我试过编辑图像窗口的安全性和所有父文件夹无济于事。

I have an ASP.NET MVC application with images in an ~/image/ directory. When I run it in development, the images show fine. When published, they do not show at all. I don't think it is a reference path issue because I've tried every combination of ../, ./, ~/, etc. I can think of. Neither css references, <img> or <asp:Image> tags work and all have the same problem. I've tried editing windows security on the image and all parent folders to no avail.

当我鼠标悬停在Firebug图像路径,图像preVIEW箱只是旋转,就像图像被发现,但无法加载。

When I mouse over the image path in firebug, the image preview box just spins as though the image is found but can't load.

很奇怪的是,当我尝试去图像直接(www.web.com/images/image.png),我重定向到默认的登录页面。这ASP.NET MVC放入项目的默认帐户控制是在我的应用程序,但我还没有实现任何日志对照呢。所以,我认为这是身份验证的问题。也许这是一个IIS问题?

The very strange thing is that when I try to go to the image directly (www.web.com/images/image.png), I am redirected to the default log in page. The default account controller that ASP.NET MVC puts in projects is in my app, but I have not implemented any log in controls yet. So I think it's an issue with authentication. Or perhaps it is an IIS issue?

我AP preciate任何帮助,您可以给。我一直停留在这将近一个星期,可能不得不放弃图像一起我不能得到这个排序。

I appreciate any help you can give. I have been stuck on this for almost a week and may have to abandon images all together I can't get this sorted.

推荐答案

我终于想通了。有问题的图像文件进行加密。右键单击图像文件 - >属性 - >高级按钮常规选项卡上 - >取消选中加密内容以便保护数据 - >确定 - >确定

I FINALLY figured it out. The image file in question was encrypted. Right click the image file -> properties -> advanced button on general tab -> uncheck "Encrypt contents to secure data" -> OK -> OK.

时,我注意到的文件名是绿色的Windows资源管理器关闭终于来了一角。我看到绿色的文件名都没有问题的时候,所以我不认为它是什么。这时我才发现这是在整个Web应用程序文件夹中唯一的绿色文件。把2和2在一起,它立即工作。谢谢大家对你的帮助。

The tip off finally came when I noticed the file name was green in windows explorer. I see green file names all the time with no problems so I didn't think anything of it. Then I noticed it was the only green file in the entire web app folder. Put 2 and 2 together and it worked instantly. Thanks everyone for your help.

这篇关于图片没有显示在发布的ASP.NET MVC网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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