无法将DatePicker添加到模态 – 在背景中显示

我试图插入一个我在这里找到的DatePicker: http : //www.eyecon.ro/bootstrap-datepicker/但我不能让它显示在我的模态前面。 (我可以在模态的背景下看到它)

我不确定我是否错误地实现了它,或者我是否需要将它安装在模态显示的顶部。

这是我的Bundle.config,其中我添加了bootstrap-datapicker.jsbootstrap-datapicker.js文件。

 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 StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/datepicker.css", "~/Content/site.css")); bundles.Add(new ScriptBundle("~/bundles/myscript").Include( "~/Scripts/MyScripts.js", "~/Scripts/bootstrap-datepicker.js")); } } 

这是我的模态

  

所以它似乎“似乎”正常工作,除了我不能点击日历中的任何内容,因为它出现在背景中。

这是一张图片供参考 在此处输入图像描述

任何和所有帮助都有效!

我是很多新手,所以如果解决方案有点棘手,我们会欢迎详细解释! 🙂

这是一个CSS问题:

模态日期选择器位于模态后面,因此:

CSS

 .datepicker{ z-index: 1100 !important; } 

如果datepicker小部件很好.ui-datepicker