簡體   English   中英

CSS未應用於IIS上部署的ASP.NET MVC應用

[英]CSS not being applied for ASP.NET MVC app deployed on IIS

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.

在每個頁面中添加以下內容可解決IE上的UI和功能問題:

<meta http-equiv="x-ua-compatible" content="ie=edge"> 

遇到了同樣的問題。 原來,這是與IIS中靜態內容相關的設置。

這是答案的鏈接: CSS,圖像,JS未在IIS中加載

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM