Controllercode:
01.
namespace
vEF_AspApplication.Controllers
02.
{
03.
public
class
AddressesController : Controller
04.
{
05.
private
MyDataModelContext db =
new
MyDataModelContext();
06.
07.
// GET: Addresses
08.
public
async Task<ActionResult> Index()
09.
{
10.
var addresses = db.Addresses.Include(a => a.FormOfAddress).Include(a => a.Title);
11.
return
View(await addresses.ToListAsync());
12.
}
13.
}
14.
}
Viewcode:
01.
@(Html.Kendo().MobileView()
02.
.Title("EntityFramework DataAccess")
03.
.Name("Index")
04.
.Content(@<
text
>
05.
<
div
id
=
"AddressList"
>
06.
@(Html.Kendo().Grid<
vEF_Library.Address
>()
07.
.Name("AddressGrid")
08.
.Columns(columns =>
09.
{
10.
columns.Bound(c => c.LastName);
11.
columns.Bound(c => c.FirstName);
12.
columns.Bound(c => c.Phone);
13.
})
14.
.HtmlAttributes(new { style = "height: 100%;" })
15.
.HtmlAttributes(new { style = "width: 100%;" })
16.
.Scrollable()
17.
//.Groupable()
18.
.Sortable()
19.
.Pageable(pageable => pageable
20.
.Refresh(true)
21.
.PageSizes(true)
22.
.ButtonCount(10))
23.
.DataSource(dataSource => dataSource
24.
.Ajax()
25.
.Read(read => read.Action("Index", "Addresses"))
26.
)
27.
)
28.
</
div
>
29.
</
text
>)
30.
)
What is wrong?