用于MVC4的jQuery datatables bundleconfig?

时间:2013-03-14 19:44:12

标签: jquery asp.net-mvc-4 datatables nuget

Nuget在VS 2012的不同文件夹中安装jQuery DataTables -1.9.4。参见图片。 如何将它们与现有的bundleConfig捆绑在一起?enter image description here

我当前的捆绑包是

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));
   bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));
   bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));
   bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));
   bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
   bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));

1 个答案:

答案 0 :(得分:7)

您只需将相应的行添加到.css包和.js包

即可

<强> .JS

"~/Scripts/DataTables-1.9.4/media/js/jquery.dataTables.js",

<强> .CSS

"~/Content/DataTables-1.9.4/media/css/jquery.dataTables.css",