You cannot use Ajax.ActionLink but you could AJAXify the links. Put the pager in a <div>
:
<div id="myPager">
@Html.PagedListPager(
Model,
page => Url.Action(
"Index",
new {
humanID = ViewBag.HumanID,
page = page
}
),
new PagedListRenderOptions
{
LinkToFirstPageFormat = "<<",
LinkToPreviousPageFormat = "prev",
LinkToNextPageFormat = "next",
LinkToLastPageFormat = ">>",
}
)
</div>
and then AJAXify the links:
$(function() {
$('#myPager').on('click', 'a', function() {
$.ajax({
url: this.href,
type: 'GET',
cache: false,
success: function(result) {
$('#some_grid_container').html(result);
}
});
return false;
});
});
Notice that in the success
callback I've used $('#some_grid_container')
which should be some wrapping div around your entire table.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…