In my ASP.NET MVC application, I add CSS and JavaScript files as follows:
@Script.AddCss("~/Content/css/style2.css", siteWide: true) @Script.AddCss("~/Content/css/tipsy.css", siteWide: true) @Script.AddJavaScript(localPath: "~/Content/js/modernizr-2.5.3.js", siteWide: true) @Script.AddJavaScript(localPath: "~/Content/js/jquery/jquery.datatables.js", siteWide: true)
And the result is as follows:
@Script.OutputCss()
And almost the same for JavaScript:
@Script.OutputJavaScript()
The template engine then merges all the files into AXD files and places them in the page source, preserving the content type.
This works fine in all browsers, but not in IE9. Sometimes style sheets do not load, and the following error message appears in the console:
SEC7113: CSS was ignored due to mime type mismatch scripts.axd?type=Stylesheet&hash=74A0F67DE9D74AFCDAE1AA539EA11099
In addition, when viewing the Network tab, AXD files are downloaded twice - 2 AXD files for CSS and 2 AXD files for JavaScript. One of the files weighs 0 bytes. This does not always happen, but only sometimes, too often.
Can someone help me with advice on where the problem is?
Thanks in advance.
cycero
source share