【发布时间】:2014-07-22 19:01:06
【问题描述】:
Environment:
Visual Studio 2013
ASP.NET MVC 5
Windows 8.1 (both dev and deployment server)
我的应用程序使用 localhost 在 Visual Studio 环境中按预期显示和执行。
但是,当我部署到我的 IIS 服务器时,我发现了两个问题(可能是相关的,因此包括这里)。
Installed as an app on the default site and accessed via http://myMachineName/myApp
1. Page doesn't render correctly. Everything is on the page, but the CSS is not being applied.
2. The code behind does NOT execute.
Installed as a new site and accessed via its port number: http://myMachineName:81
1. Page doesn't render correctly. Everything is on the page, but the CSS is not being applied.
2. The code behind does execute correctly.
【问题讨论】:
-
检查浏览器的开发者工具,看看你的css文件是否正在加载
-
路由中的路径是否正确?你有添加inetpub localhost吗?源路径中的 css 是否正确?
-
@Zaki 我该怎么做?我在寻找什么? (我在 Windows 8 上使用 IE)
-
在 IE 中:按 F12 转到网络选项卡并单击运行,然后刷新...
-
@Zaki 看起来 CSS 正在加载/应用,但是在本地运行的应用程序和从 IIS 运行的应用程序的外观和感觉肯定不同。为什么它的行为/外观会有所不同?
标签: css asp.net asp.net-mvc iis