Windows 8的IIS不加载在asp.net应用样式表和图像 [英] Windows 8 IIS does not load stylesheets and images in asp.net app

查看:268
本文介绍了Windows 8的IIS不加载在asp.net应用样式表和图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装的Windows 8我的电脑上,并试图加载我的ASP.net应用程序。该页面加载,没有任何问题。但没有了位于App_Themes文件目录加载图像或样式表。我有在它具有图像的单独的文件夹,他们做负载。我认为这是一些安全问题,但我不能找出它可能是什么。如果我那么网站加载正确部署站点到我的dev 2008 R2中,但它并不在我的Windows 8盒正确加载。

I just installed Windows 8 on my computer and tried to load my ASP.net application. The page loads with no problems. But none of the images or stylesheets that are located in the App_Themes directory load. I do have a separate folder that has images in it and they do load. I think it is some security issue but I can't find out what it could be. If I deploy the site to my dev 2008 R2 box then the site loads correctly, but it doesn't load correctly on my Windows 8 box.

我的链接的一些例子:

<link href="../App_Themes/Debug/style.css" type="text/css" rel="stylesheet" />

以上不加载。

<img id="ctl00_imgCompanyLogo" title="Header Logo" src="../Images/EmailImage.aspx?ID=6C633997-065C-44AD-9839-B754005B7995" style="border-width:0px;height:50px;width:220px;margin-left: 10px" />

不过,这种人做。

However, this one does.

注:没有错误加载页面文件根本就没有上加载

Note: No errors are loaded on the page the files simply don't load.

更新:我也应该注意到,这没有工作时,我是使用Windows 7来写我的code

Update: I should also note that this did work when I was using Windows 7 to write my code.

更新:我添加了一个HTML页面到我的应用程序,并单击右侧上该网页没有呈现。但是,如果我创建一个新项目,页面呈现完美。

Update: I added a html page to my application and right clicked on that and that page didn't render. However, if I create a new project, the pages render perfectly.

UPDATE2:我想我找到了问题的根源,但我不知道该怎么办才好。如果您在Windows 8机器上创建一个新的项目,然后更改项目,以便它使用虚拟目录不IISEx preSS(使用Project URL)则没有样式负荷和图像不会加载为好。

Update2: I think I found the root of the issue but I don't know what to do about it. If you create a new project on a Windows 8 machine then change the project so that it uses the virtual directory not IISExpress (use the Project Url) then none of the stylesheets load and the images won't load as well.

推荐答案

我有一个愚蠢的时刻。我没有检查的常见HTTP功能组中的IIS配置下的静态内容复选框。

I had a stupid moment. I didn't check the Static Content check box under the Common HTTP Features group of the IIS configuration.

这篇关于Windows 8的IIS不加载在asp.net应用样式表和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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