c# - spliting a list and using for a paging effect -


i have below list made database bring x number results. split result list of 15 have list<list<subjectmodel>> split list model.
know can this, there may not complete spilt 15 final have less. on mvc if create paging effect how can done calling diffent index of data loaded or have go server each time.
i presume have have parial page within page.

list<subjectmodel> model = new list<subjectmodel>(); 

generally can use .skip() , .take() linq methods in following way:

.skip(pagesize * pagenumber - 1).take(pagesize)  

i recommend not fetch all, split, instead real paging using methods above. when using methods against real o/r mapper entity framework, translate rdbms's sql.

you can use action method parameters in controller know page requested. pagesize constant or configuration value.

you can start learn whole concept googling: [implement paging in asp.net mvc]


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -