How does pagination work in ASP.NET(Using VB.NET)?

前端 未结 2 1904
时光说笑
时光说笑 2021-01-26 17:05

I know how to create and populate a datatable, which i have already done. Now, I simply want to display the datatable on a webform, but I also want to know how to paginate and

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-26 17:53

    First you have to store your data into the session object/ viewstate /cache

    Then generate table/ div according to your requirement and use loop for no. of records you want to display on screen * current page no +1.(current page no you have to store in viewsate or in hidden field)

    For sorting use link on header (use table header with link) then for sorting use Linq. (after sorting data you have to replace your session object/ viewstate /cache object ) You can generate header using column’s name

提交回复
热议问题