I have a view have 10 record , i want when i click buttion loadmore then get add 10 record next from database.
this is view
@model IEnumerable
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
var page = (int)ViewData["page"];
}
Index
@foreach (var item in Model)
{
@item._ID------@item._Name-----@item._Age----@item._Adress
$(document).ready(function () {
$(".page-number").click(function () {
var page = 1;
$.ajax({
type:"POST",
url: '@Url.Action("Index", "Home")',
data: { "page":page+2},
async: true,
success: function (data) {
$("#listStudent").html(data);
}
});
});
});
and cotroller
public ActionResult Index(int page=1)
{
List Students = Getdata(page);
ViewData["page"] = page;
return View(Students);
}

Saineshwar BageriRank #115 · 19.6K reputationPosted Jun 12, 2015, 9:47 PM EDT
duong do14 reputationPosted Jun 13, 2015, 12:12 AM EDT
Sanjay SabariyaRank #2,262 · 623 reputationPosted Jun 13, 2015, 2:57 AM EDT
duong do14 reputationPosted Jun 13, 2015, 8:01 AM EDT