我遇到任何图像(未存储在“/ Images”文件夹中)的问题。我的应用程序正在添加样式规则以自动隐藏图像。下面是输出HTML:asp.net图像(不在图像文件夹中)被嵌入式样式隐藏
<img id="MainContent_OrderAdsFormView_AdImagePreview" class="img-responsive" src="../Images/Ads/Stock/slide_01.jpg" width="0" height="0" style="display: none !important; visibility: hidden !important; opacity: 0 !important; background-position: 0px 0px;">
这里的服务器控件:
<asp:Image runat="server" ID="AdImagePreview" ImageUrl="~/Images/Ads/Stock/slide_01.jpg" CssClass="img-responsive" Visible="true" />
正如你可以看到,即使设置能见度为true没有帮助。我在Images文件夹中显示任何图像而不是在子目录中没有问题。我必须在Images文件夹下有子目录。我不能将所有图片移动到Images文件夹。我没有权限问题,因为我可以直接在浏览器中打开图片网址。这是愚蠢的造型规则。我不知道他们来自哪里。为什么我的应用程序添加了这种样式规则以及如何阻止它!请帮忙,我真的被卡住了!
听起来像你可能使用一些JavaScript? (class =“img-responsive”)...你显示的代码是可以的,不能成为这个问题的根源,所以这绝对是你“忘记”告诉我们的东西。或者,也许一些积极的浏览器插件负责像meda在答案中建议的。 – walther 2014-10-18 22:26:43