Asp.net mvc 添加Jquery UI
生活随笔
收集整理的這篇文章主要介紹了
Asp.net mvc 添加Jquery UI
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.使用NuGet下載jquery ui
Install-Package jQuery.UI.Combined
2.下載多語言文件:
development-bundle/i18n目錄下是jquery的日歷語言。注:只有Legacy版本才有
也可以用nuget下載
Install-Package jQuery.UI.i18n
2.編輯?BundleConfig.cs
注意:這里我用了自己下載的一個theme"start",自己下才有 http://jqueryui.com/download/
?
//jquery-uibundles.Add(new ScriptBundle("~/bundles/jqueryui").Include("~/Content/themes/start/jquery-ui.js"));bundles.Add(new StyleBundle("~/Content/jqueryui").Include("~/Content/themes/start/jquery-ui.css"));bundles.Add(new ScriptBundle("~/Content/themes/i18n").Include("~/Content/themes/i18n/jquery.ui.datepicker-zh-CN.js"));?
3.編輯_Layout.cshtml頁
@Scripts.Render("~/bundles/jquery")@Scripts.Render("~/bundles/jqueryui")@Scripts.Render("~/Content/themes/i18n")?
4.在view頁面中使用
<input id="datepicker" > <!-- Datepicker --><script>$("#datepicker").datepicker({inline: true});</script>5.下面測試一下:
轉載于:https://www.cnblogs.com/wangbin5542/p/5083246.html
總結
以上是生活随笔為你收集整理的Asp.net mvc 添加Jquery UI的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 原创:杜甫喝醉后一句话,让人瞬间明白他为
- 下一篇: HTML5 编辑 API 之 Range