@{
    ViewBag.Title = "Home Page";
}

@Html.AntiForgeryToken()

@(Html.Kendo().Grid<KendoMVCWrappers.Models.Person>().Name("persons")
            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model=>model.Id(m=>m.PersonID))
                    .Read(read => read.Action("GetPersons","Home").Data("sendAntiForgery"))
                    .Update(up => up.Action("UpdatePerson", "Home").Data("sendAntiForgery"))
            )
            
            .Columns(columns =>
            {
                columns.Bound(c => c.PersonID);
                columns.Bound(c => c.Name);
                columns.Command(cmd => cmd.Edit());
            })
            
            .Pageable()
            .Sortable()
        )


<script type="text/javascript">
    function sendAntiForgery() {
        return { "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val() }
    }
</script>
