开发者

MVC 3 - css is not rendering

开发者 https://www.devze.com 2023-03-01 17:44 出处:网络
This is my fault because I messing with two css files. So I deleted both css files from the content folder. Replaced it again wit开发者_如何学JAVAh just one Site.css file. Updated in _Layout.cshtml fi

This is my fault because I messing with two css files. So I deleted both css files from the content folder. Replaced it again wit开发者_如何学JAVAh just one Site.css file. Updated in _Layout.cshtml file, from shared folder, like so...

<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

So now it is not updating. Just getting plain outlook, when runnung the program. Also tried with with Site.Master in shared folder...no luck, don't know where else to look.

Any sugguestion?


I think I removed _ViewStart.cshtml in views folder. So I created one and its seems to solve the problem.


I had a similar issue tonight and I found that even though my Content\Site.css file did start with a capital "S", in my layout I had to use a lower "s" (Content\site.css) for my stylesheet to show up properly in IE. In Chrome it worked fine either way.


This is a permission issue: Please give permissions to: IIS_USR and IUSR to your website folder. It will fix the problem.


Make sure the reference to your stylesheet starts with the tilde character. For example:

<link href="~/Content/bootstrap.min.css" rel="stylesheet">

If you don't specify the leading "~/", then the server won't be able to find the CSS file when you reference a page directly. For example, wwww.myserver.com/Home/Index won't work, but www.myserver.com will.

0

精彩评论

暂无评论...
验证码 换一张
取 消