【发布时间】:2017-06-15 13:52:49
【问题描述】:
我正在尝试将引导表与 MVC 一起使用。我在脚本和内容中有以下文件:
bootstrap-table.js
bootstrap-table.min.js
bootstrap-table-locale-all.js
bootstrap-table-locale-all.min.js
bootstrap-table.css
bootstrap-table.min.css
然后我在 bundleconfig.cs 文件中使用以下内容:
bundles.Add(new ScriptBundle("~/bundles/bootstraptable").Include(
"~/Scripts/bootstrap-table*"));
bundles.Add(new StyleBundle("~/Content/bootstraptable").Include(
"~/Content/bootstrap-table*"));
这些在“_Layout.cshtml”文件中:
@Styles.Render("~/Content/bootstraptable")
@Scripts.Render("~/bundles/bootstraptable")
我还包含 jQuery 和 Bootstrap(并且可以正常工作),所以我认为这不是依赖问题。
当我运行项目时(甚至在我尝试对表格做任何事情之前),我得到:
Unable to get property 'locales' of undefined or null reference
没有用于此的 NuGet 包,所以我不得不手动添加文件,所以也许我错过了一些东西。但根据网站 (http://bootstrap-table.wenzhixin.net.cn/getting-started/) 看来,我有我需要的东西。
有人遇到过这个问题或知道我做错了什么吗?
谢谢。
【问题讨论】:
标签: javascript asp.net-mvc twitter-bootstrap bundling-and-minification bootstrap-table