Stylesheets not loading in IE 9 despite mime type

流过昼夜 提交于 2019-12-01 09:20:20

Ok, eventually found the problem. This was not a problem with the mime type and I hope this will save someone a few hours. IE9 limits the size of css files to about 250kb, because I'm using bundling and minification one of my css bundles were exceeding this limit and the file was truncated, resulting in some of the styles not being applied.

The fix was rather easy, I split my css bundle into two bundles, for example

 bundles.Add(new StyleBundle("~/Bundles/Shared/CSS").Include(
            "~/Content/bootstrap/bootstrap.min.css",
            "~/Content/font-awesome.min.css",
            "~/Content/silviomoreto-bootstrap-select/bootstrap-select.min.css",
            "~/Content/kendo/kendo.common.min.css"));

  bundles.Add(new StyleBundle("~/Bundles/SharedTwo/CSS").Include(
            "~/Content/datepicker/css/datepicker.css",
            "~/Content/kendo/kendo.bootstrap.min.css",
            "~/Content/bootstrap-touchspin-master/libraries/prettify/prettify.css",
            "~/Content/bootstrap-touchspin-master/libraries/prettify/demo.css",
            "~/Content/css/Shared/Index.css"));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!