Get items in current page from ASP .NET PagedDataSource
I am impl开发者_如何学编程ementing paging on a custom server control, and I'm wondering if I can use the PagedDataSource to my advantage. Is there a way to get the items just from the current page of the PagedDataSource? Will this work to do this?
For Each item As Object In pagedDataSource
I went ahead and tried this, and this does work. As long as you set up the PagedDataSource correctly (set AllowPaging, PageSize, and CurrentPageIndex, and, of course, DataSource), then you can use
For Each item As Object In pagedDataSource
to iterate through the current page of items.
精彩评论