如果在Mvc Razor视图中不支持日期选取器Jquery那么我该如何使用它? [英] If Date Picker Jquery Is Not Supported In Mvc Razor View Then How Can I Use It?

查看:58
本文介绍了如果在Mvc Razor视图中不支持日期选取器Jquery那么我该如何使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mvc 4.但我的项目不支持普通的javascript和jquery。添加@ Scripts.Render(〜/ bundles / jquery)后,支持一些jquey。但是我的项目不支持日期选择器,我该怎么办?

i'm using mvc 4. but normal javascript and jquery is not supported in my project. after adding @Scripts.Render("~/bundles/jquery") some of jquey is supported.but the date picker is not supported in my project,what can i do ?

推荐答案

为此您必须将jQuery UI添加到您的项目中。请尝试如下。



BundleConfig文件:



For that you have to add jQuery UI into your project.Please try is as below.

BundleConfig file:

bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
            "~/Scripts/jquery-ui-{version}.js"));





在您的布局页面上:




On your layout page:

@Scripts.Render("~/bundles/jqueryui")





对于css



For 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"));





On Your布局页面



On Your layout page

@Styles.Render("~/Content/themes/base/css")


感谢您的回复。但很遗憾地说它不起作用。实际上我不明白这个问题,我的一些项目页面支持jquery和另一个不支持。问题是什么?
Thanks for the Reply. But sorry to say its not working. actually i dont understand about the problem,some of my project page support jquery and another cant support. whats the problem?


这篇关于如果在Mvc Razor视图中不支持日期选取器Jquery那么我该如何使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆