0
我已經在我的BundleConfig.cs以下文件CSS捆綁不會在asp.net mvc4應用工作
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/reset.css",
"~/Content/site.css"));
在我_Layout.cshtml文件我設置的樣式像這樣
@Styles.Render("~/Content/css")
當我設置調試在web.config文件錯誤我得到這個在HTML源
<link rel="stylesheet" href="/Content/css?v=o98MVeaPnTOPDtb6WAqw14YyALxEnOYDmGqwfyBAiq01">
The resource from this url is not text: http://localhost:1135/Content/css?v=o98MVeaPnTOPDtb6WAqw14YyALxEnOYDmGqwfyBAiq01
</link>
,沒有的款式得到應用。我在這裏錯過了什麼?
不確定iis express或vs server是否正確顯示MIME頭文件。直接引用css文件,看看頭文件是否仍然正確。 – Robert
嗨羅伯特,好像我有一個名爲Css的文件夾在Content文件夾中。當我更改名稱Css - >樣式一切工作正常; o) –
奇怪,我在這裏使用/ content/css&/ content/js,並且事情工作正常(但不要使用捆綁)。也許與需要報告的綁定有關的錯誤 – Robert