I want to bind to a controller called articles but am getting an exception as follows
0x800a138f - JavaScript runtime error: Unable to get property 'DataSource' of undefined or null reference
<!DOCTYPE html >
<HTML>
<head>
<title>content</title>
<link href="~/Content/kendo/2012.2.710/kendo.common.min.css" rel="stylesheet" />
<link href="~/Content/kendo/2012.2.710/kendo.default.min.css" rel="stylesheet" />
</head>
<body>
<div id="articlesgrid"> </div>
<script src="~/Scripts/jquery-1.7.2.js"></script>
<script src="~/Scripts/kendo/2012.2.710/kendo.web.min.js"></script>
<script>
$(function()
{
$("#articlesgrid").kendoGrid(
{
dataSource: new kendo.Data.DataSource({
transport: {
read : "Api/Articles"
}}
)
})
}
);
</script>
</body>
</HTML>
#''''''''''''''''''''''''''''''''''''''''''''''''''''''''
public class ArticlesController : Controller
{
public List<Article> Get()
{
List<Article> lst = new List<Article>();
lst.Add(new Article() { ID = 1, Name = "AAA", Price1 = 1.22m });
lst.Add(new Article() { ID = 1, Name = "BBB", Price1 = 1.32m });
lst.Add(new Article() { ID = 1, Name = "CCC", Price1 = 1.42m });
return lst;
}
}
}