【发布时间】:2013-01-11 18:26:42
【问题描述】:
我刚开始使用 Kendo UI 并做了this 教程来学习基础知识,我在 Visual Studio 202 上为 MVC Web 应用程序项目创建了一个新的 Kendo UI 并决定测试我学到的东西,我试着把网格就像教程中一样,但未能运行它。
我的意思是无法识别剑道功能,这不应该发生,因为该项目已经有带有 js 文件的剑道文件夹。
我的视图如下所示:
<!DOCTYPE html>
<html>
<head >
<link href="Content/kendo/2012.2.710/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="Content/kendo/2012.2.710/kendo.default.min.css" rel="stylesheet" type="text/css" />
<title><%: ViewBag.Title %></title>
</head>
<body>
<h1><%: ViewBag.GestionTitle %></h1>
<div id="tweetGrid"></div>
<script src="Scripts/jquery-1.8.2.min.js"></script>
<script src="Scripts/kendo/2012.2.710/kendo.web.min.js"></script>
<script>
$(function () {
var ds = new kendo.data.DataSource({
transport: {
read: {
url: "http://search.twitter.com/search.json?q=kendoui",
dataType: "jsonp"
}
},
schema: {
data: "results"
}
});
$("#tweetGrid").kendoGrid({
columns: ["from_user", "from_user_name", "text"],
dataSource: ds
});
});
</script>
</body>
</html>
我尝试将脚本放在头部和身体内,但无法让剑道功能正常工作。我错过了什么?
【问题讨论】:
-
“无法使剑道功能发挥作用”具体是什么意思? JavaScript 控制台是否显示错误?错误是什么?是说函数没有定义吗?浏览器真的拿到了 kendo.web.min.js 文件吗?
-
它说加载资源失败:服务器响应状态为 404(未找到),它正在搜索 localhost:65097/Test/Scripts/kendo/2012.2.710/kendo.web.min.js 上的脚本我不知道为什么要在那里寻找它们,它应该在localhost:65097/Scripts/kendo/2012.2.710/kendo.web.min.js 中查找它们,我在视图中引用它们是否错误?
标签: javascript asp.net-mvc telerik kendo-ui