开发者

How to perform server-side pagination by using a GridView and a DataPager in Asp.net 3.5?

开发者 https://www.devze.com 2022-12-20 15:05 出处:网络
I have a webform which uses a gridview control to show result of a search operation. I wanna to take advantage of using pagination in the webform. But as you all 开发者_开发问答know, gridview paginat

I have a webform which uses a gridview control to show result of a search operation.

I wanna to take advantage of using pagination in the webform. But as you all 开发者_开发问答know, gridview pagination is a client-side pagination and it transfers all records have been selected to the client. What I mean by client-side pagination is the client (page) shows records page by page but every time the user clicks on a page link to navigate through records, all the records are selected from Data Source.

How can I use gridView with datapager in order to have a server side pagination? Or any other solution to get records page by page by configuring our query?


I think you're wrong: GridView paging is server-side. See this MSDN article for details: http://msdn.microsoft.com/en-us/library/aa479347.aspx

Update: Now I see what you mean. If you don't want to select all records on every request, then "Custom Paging" is probably what you are looking for. See here for a tutorial: https://web.archive.org/web/20211020140032/https://www.4guysfromrolla.com/articles/031506-1.aspx (BTW: this site has lots of great tutorials, e.g. about data binding).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号