The first time I do paging it works fine. When I place the cursor over footer paging, it looks like
http://localhostt:62535/Account/Index?page=3
If I perform any operation on WebGrid (edit or delete or visible), then the paging url is changed to something like
http://localhostt:62535/Account/VisibleCountry?Id=101&page=3
code
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/User.cshtml";
WebGrid grid = new WebGrid(Model.OrderBy(m=>m.idVal), canSort: true, canPage: true, rowsPerPage: 20,
selectionFieldName: "selectedRow", ajaxUpdateContainerId: "stategrid");
}
<div id="countrygrid" align="center">
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "select",
columns: new[] {
grid.Column("CountryName","Country Name"),
grid.Column("",header:"Action",format:@<text>
@Html.ActionLink("Edit", "Edit", new { id=item.CountryId })
|
@if (item.deleted == false)
{
<a href="#?id=@item.CountryId" onclick="changeCountry(this)" title="Disable">Disable</a>
}
else
{
<a href="#?id=@item.CountryId" onclick="ChangeCountry(this)" style="color:red" title="Enable">Enable</a>
}
</text>),
grid.Column("",header:"Action",format:@<text><a href="#" id="@item.CountryId" class="countryIdValues" >Addstate</a></text>)
});
</div>
I am not understanding why the url is changing. Can any one help me with this?