Hello,
I'm trying to create a kendo list view in razor c#. For some reason, when my view loads, the read.action gets hit, but it never enters my controller. I cant figure out why that is. Also, when I manually bind the data source using bindto(), i get the data back but it never gets rendered in the template. What am i doing wrong?
Here is my listview wrapper :
@(Html.Kendo().ListView<DAL_NEW.proc_GetDepartmentArticles>()
.Name("DepartmentArticlesList")
.ClientTemplateId("template")
.TagName("div")
.DataSource(datasource =>
{
datasource.Model(model => model.Id(p => p.Article_ID));
datasource.Read(read => read.Action("GetDepartmentArticles", "Departments", new { departmentID = Model.CurrentSection.Section_ID.ToString() }));
datasource.PageSize(15);
})
.Pageable()
)
Here is the template (this isnt a real template, just for testing) :
<script type="text/x-kendo-template" id="template">
<div>
<p> ${Title}</p>
<p> #=Title#</p>
<p> #:Title#</p>
</div>
</script>
Here is the controller :
public ActionResultGetDepartmentArticles([DataSourceRequest]DataSourceRequest request,string departmentID)
{
List<proc_GetDepartmentArticles> articleList = db.Proc_GetDepartmentArticles(Pub.Pub_ID, Convert.ToInt32(departmentID)).ToList();
return Json(articleList.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}