IE不会加载css文件

时间:2014-11-24 20:43:06

标签: html css asp.net internet-explorer iis-7.5

我的Asp.net MVC解决方案是由安装在IIS 7.5上的另一家公司开发的。

网站运行得很好 - 但是当我在IE 10 / IE 11中打开网站时,没有加载CSS样式。

使用谷歌浏览器时,CSS样式按预期应用,每个人都很高兴 - 期待我的老板。他希望解决方案能够在IE中运行。

我无法弄清楚出了什么问题。

我已经查看了该页面的来源,并尝试将该链接复制到新的浏览器标签中 - 我得到了回复。

该网站包含在“受信任的站点”中,“受信任的站点”的安全设置被降至最低。该网站也被纳入“兼容模式”。

该解决方案是在Visual Studio 2013,.NET 4.5中开发的。我不知道如何看待使用的MVC版本 - 我只开发了WebForms。当我在本地计算机上启用调试器从VS2013运行站点时,IE会完美地显示页面。

该解决方案尝试实现脚本文件的捆绑,以避免限制CSS / javascript文件的总链接。

 public class BundleConfig
{
    // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                  "~/Scripts/jquery.validate*"));

        // Use the development version of Modernizr to develop with and learn from. Then, when you're
        // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));

        bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                  "~/Scripts/bootstrap.js",
                  "~/Scripts/respond.js"));

        bundles.Add(new ScriptBundle("~/bundles/custom").Include(
                "~/Scripts/custom.js",
                "~/Scripts/custom.js"));

        bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap.css",
                  "~/Content/site.css"));

        BundleTable.EnableOptimizations = true; 
    }
}

我希望你们中的一些人可以指出我正确的方向。

0 个答案:

没有答案