MVC应用程序中的错误

本文关键字:错误 应用程序 MVC | 更新日期: 2023-09-27 17:59:12

我是网络开发的新手,已经开发了我的第一个MVC应用程序。在我的开发机器上,一切都很正常,看起来也很好,但当我把它发布到服务器上时,我在Internet Explorer中遇到了一些错误。但在其他浏览器中,一切看起来和工作都很正常,例如谷歌Chrome。

有人知道我做错了什么吗?这样我就知道该找什么了?如果你需要查看任何代码,请让我知道哪些部分,因为我不知道我做错了什么。

错误消息

//编辑以下是我在_Layout.cshtml 的head标记中的引用

@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@Scripts.Render("~/bundles/bootstrap")

我的BundleConfig.cs看起来像这个

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",
                  "~/Scripts/bootbox.min.js"));
        bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap.css",
                  "~/Content/Site.css"));
        bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
        "~/Scripts/jquery-ui-{version}.js"));
        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                      "~/Content/themes/base/accordion.css",
                      "~/Content/themes/base/all.css",
                      "~/Content/themes/base/autocomplete.css",
                      "~/Content/themes/base/base.css",
                      "~/Content/themes/base/button.css",
                      "~/Content/themes/base/core.css",
                      "~/Content/themes/base/datepicker.css",
                      "~/Content/themes/base/dialog.css",
                      "~/Content/themes/base/draggable.css",
                      "~/Content/themes/base/menu.css",
                      "~/Content/themes/base/progressbar.css",
                      "~/Content/themes/base/resizable.css",
                      "~/Content/themes/base/selectable.css",
                      "~/Content/themes/base/selectmenu.css",
                      "~/Content/themes/base/slider.css",
                      "~/Content/themes/base/sortable.css",
                      "~/Content/themes/base/spinner.css",
                      "~/Content/themes/base/tabs.css",
                      "~/Content/themes/base/theme.css",
                      "~/Content/themes/base/tooltip.css"));
    }

MVC应用程序中的错误

我终于找到了导致这个问题的原因。

在Internet Explorer设置中,选择了"在兼容性视图中显示intranet站点"。取消选中它,现在一切正常。