Search code examples
c#asp.netpagination

Repeater control paging


I've got a repeater control containing comments. I'm about to implement ajax paging to it. I was opting to use the updatepanel (conditionally) for this thing, but I guess it's going to get kinda slow in production environment (Each time about 20 rows will be visible).

Do you guys have any other ideas on how to do this? I want to keep the repeater control since it contains other controls as well so I can't use a js (templates)/json approach.


Solution

  • Do the paging inside a stored procedure. You can use a common table expression with the ROW_NUMBER() function to limit your results to 20 rows. Using an Update Panel might be a little slower than just passing JSON data asynchronously but it plays well with the Repeater control.