Thursday, 27 July 2017

paging in asp.net mvc through linq

a model binder converts posted form values to CLR types and passes them to the action method in parameters.

Server side paging

int numberOfObjectsPerPage = 10;
var queryResultPage = queryResult
  .
Skip(numberOfObjectsPerPage * pageNumber)
  .
Take(numberOfObjectsPerPage);

No comments:

Post a Comment