MVC:我已经部署了应用程序,但是当我登录CSS只能 [英] MVC: I have deployed my application, but CSS only works when I log in
问题描述
我已经部署了我MVC应用程序,但是当我从IIS浏览我发现窗体身份验证似乎要禁止的CSS。
这不会发生我的dev的服务器上。
为什么会出现这种情况?
我的母版页这个样子的;
I have deployed my MVC app but when I browse from IIS I find that the forms authentication seems to block the CSS. This does not happen on my dev server. Why would this happen? My master page look like this;
<head id="Head1" runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.js" type="text/javascript" language="javascript"></script>
<script src="http://nje.github.com/jquery-tmpl/jquery.tmpl.js" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/jquery.form.js")%>" type="text/javascript"></script>
<!-- note that the order scripts are included in is important -->
<script src="<%=Url.Content("~/Scripts/jquery.Validate.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/MicrosoftMvcJQueryValidation.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/ConfusedValidation.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/Awesome.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/MicrosoftAjax.debug.js") %>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/MicrosoftMvcAjax.debug.js") %>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/jquery.jcacher-1.0.0.min.js")%>" type="text/javascript"></script>
<link href="<%=Url.Content("~/Content/jquery.ui.autocomplete.css")%>" rel="stylesheet" type="text/css" />
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/overcast/jquery-ui.css"
type="text/css" rel="Stylesheet" class="ui-theme" />
<link href="<%=Url.Content("~/Scripts/Awesome.css")%>" rel="stylesheet" type="text/css" />
的*编辑的 * 的
在萤火虫我得到的消息;
无法加载来源: http://192.168.100.999/Content/Site.css
其实我得到这个对所有本地文件。
* EDIT * In Firebug I get the message; Failed to load source for: http://192.168.100.999/Content/Site.css In fact I get this for all the local files.
推荐答案
答案是与分配权限给用户IIS_IUSR在其中部署应用程序文件夹的事情。一位同事发现,这对我来说。我得承认我不知道为什么这是必要的,但它解决了这一问题。
The answer was to do with assigning permissions to the user IIS_IUSR to the folders in which the application is deployed. A colleague discovered this for me. I have to admit I am not sure why this is necessary but it fixed the problem.
这篇关于MVC:我已经部署了应用程序,但是当我登录CSS只能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!