@Html.Grid sorting throws "Page not found exception"

Aug 16, 2016 at 2:08 PM
Hi,

I am new to Grid.Mvc.

I have followed the steps to create a grid and it works perfectly fine to display the grid with data. But when I try to sort the grid or click a page on grid paging, it throws "Resource not found exception". Below is my grid coding..

_Layout.cshtml

<link href="@Url.Content("~/Content/Gridmvc.css")" rel="stylesheet" type="text/css"/>
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/gridmvc.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/gridmvc.js")"></script>
and my view is as follows

@if (Model.GeneralReportData.UserSummaryResultList != null)
{
<div class="row">
    <div class="col-md-12">
        @Html.Grid(Model.GeneralReportData.UserSummaryResultList).Named("usersGrid").Columns(columns =>
                {
                    columns.Add(user => user.Name).Titled("Navn").Sortable(true);
                    columns.Add(user => user.BirthDate).Titled("Fødselsdato").Format("{0:d}").Sortable(true);
                    columns.Add(user => user.UserId).Titled("BrukerId");
                    columns.Add(user => user.PrimaryOfficerName).Titled("Kontaktperson");
                    columns.Add(user => user.PrimaryOfficerDepartmentCode).Titled("Avdeling");
                }).WithPaging(20)
    </div>
</div>
}

am I missing anything?

Any comments would be greatly appreciated.

Thanks,
Suba.
Aug 17, 2016 at 9:16 PM
Problem solved when I Used HttpGet method in action
Marked as answer by getsuba on 8/17/2016 at 1:16 PM