对象不支持属性或方法“kendoDatePicker”
Posted
技术标签:
【中文标题】对象不支持属性或方法“kendoDatePicker”【英文标题】:Object doesn't support property or method 'kendoDatePicker' 【发布时间】:2015-04-14 17:34:50 【问题描述】:我使用 MV5 Razor 创建了一个新项目,但我无法在我的主页视图中运行“@(html.Kendo().DatePicker().Name("datapickerTest"))”,我已包含“Kendo .js”和“jquery 2.1.3”,但不起作用。
项目中包含参考“Kendo.Mvc”。
BundleConfig.cs:
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-2.1.3.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/site.css"));
bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
"~/Scripts/kendo/kendo.all.min.js",
"~/Scripts/kendo/kendo.timezones.min.js",
"~/Scripts/kendo/kendo.aspnetmvc.min.js"));
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
"~/Content/kendo/kendo.common-bootstrap.min.css",
"~/Content/kendo/kendo.common.min.css",
"~/Content/kendo/kendo.default.min.css",
"~/Content/kendo/kendo.dataviz.min.css",
"~/Content/kendo/kendo.dataviz.default.min.css",
"~/Content/kendo/kendo.bootstrap.min.css"));
bundles.IgnoreList.Clear();
// Set EnableOptimizations to false for debugging. For more information,
// visit http://go.microsoft.com/fwlink/?LinkId=301862
BundleTable.EnableOptimizations = true;
_Layout.cshtml:
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/kendo/css")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo")
@Scripts.Render("~/bundles/modernizr")
【问题讨论】:
已解决。我在“_Layout.cshtml :”页面的页脚中创建了这个“@Scripts.Render("~/bundles/jquery")” 【参考方案1】:已解决。我在“_Layout.cshtml:”页面的页脚创建了这个“@Scripts.Render("~/bundles/jquery")”
【讨论】:
是的,这个是罪魁祸首以上是关于对象不支持属性或方法“kendoDatePicker”的主要内容,如果未能解决你的问题,请参考以下文章
IE 11 - 无法解决“对象不支持属性或方法'charCodeAt'”或“对象不支持属性或方法'readAsBinaryString'”