I am using mvc razor ..
There , i call a actionresult from other actionresult
for exp, if i am on home page , and i click ,productlist ,
this is actionresult and as view called productlist.cshtml
I pass datatable in productlist.cshtml using model ..
and display in table using
<div id="some_grid_container">
foreach (var item in Model) {
}</div>
and after this , i use
<div id="myPager">
@Html.PagedListPager(Model, Page_No => Url.Action(@ViewBag.cururl, new { Page_No,destn,callhere}))</div>
on a href click in PagedListPager , the page refreshes,
so i dont want to refresh page, so i tried
$('#myPager').on('click', 'a', function () {
$.ajax({
url: this.href,
type: 'GET',
cache: false,
success: function (result) {
alert(result);
// $('#some_grid_container').html(result);
},
error: function (xhr, textStatus, errorThrown) {
// document.write("FAIL: " + xhr.responseText + "-" + textStatus.responseText + "-" + errorThrown.responseText);
alert("FAIL: " + xhr.responseText + "-" + textStatus.responseText + "-" + errorThrown.responseText);
}
});
return false;
});
this doesnot refresh whole page , but this shows whole html page from start inside div id="some_grid_container"..
how to refresh only div some_grid_container with Page_no =2 values , then 3 ...etc...
I hope you understood