这是this问题的延续。IE在Visual Studio和服务器上的调试之间显示页面不同
我有一个ASP.NET应用程序,在IE8中查看DEBUG时显示的部分区域显示与显示已发布的测试服务器位置不同。
当我在调试查看页面(通过VS 2010),我看到:
然而,当我发布到服务器上,直接查看它,它看起来像这样:
该标题框只有文本背景颜色为黑色而不是整个部分。
这里的CSS:
.imageBox
{
position: relative;
float: left;
border-style: solid;
border-width: 1px;
text-align: center;
}
.imageBoxTitle
{
width: 100%;
background-color: #333333;
padding: 5px;
}
.imageBoxTitleLbl
{
font-family: Verdana;
font-weight: bold;
font-size: small;
color: White;
}
这里是生成的HTML
<div class="imageBox">
<div class="imageBoxTitle">
<span id="MainContent_ImagesPanel_ImageHolder1_ImageBoxTitleLabel" class="imageBoxTitleLbl">ITEM OVERVIEW</span>
</div>
<div class="imagePlaceHolder">
<p class=".centeredImage"><a id="MainContent_ImagesPanel_ImageHolder1_ImageHyperLink" href="UserImages/nu5t3hhs.jpg" target="_blank"><img src="UserImages/nu5t3hhs.jpg" height="200" width="200" /></a></p>
<span id="MainContent_ImagesPanel_ImageHolder1_CustomValidator1" style="color:Red;visibility:hidden;">*</span>
</div>
<div class="imageAction">
</div>
</div>
所以我在想,这可能是某种形式的缓存问题。但是,如果我对CSS稍作修改(例如更改背景颜色),它会选择并显示它。另外,我已经为css文件的查询字符串添加了一个动态生成的GUID,所以它们不应该被缓存。菲德勒证实他们也没有被缓存。
当通过Visual Studio Debug进行查看vs直接从服务器访问页面时,IE似乎以不同的方式呈现HTML/CSS。
什么事情可能导致此行为?
更新:当我在发布的服务器上的Chrome或Firefox中查看页面时,它显示正确。我已经清除IE缓存(按Ctrl-F5),删除的.css关闭服务器和reloade等
IE缓存?尝试使用Ctrl + F5进行刷新,该guid可能不是enougth.Are你确定,这是一个很好的CSS文件?也许你没有把你的更新的CSS在服务器上(我想确定,因为大多数时间这些问题都有简单的解决方案) – 2010-09-22 14:28:00
我试过CTRL-F5,我已经从服务器上删除了.css文件,我在Fiddler看到它在检索时返回了200。我清除了IE缓存。如果我在Chrome中查看它,它显示正确。 – GernBlandston 2010-09-22 14:42:15
你确定这是完整的代码片断,因为这是无效的HTML - 关闭的 div'之一缺失。另外,图像在哪里? – 2010-09-22 14:52:16