tags:

views:

57

answers:

1

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.

A: 

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.

Dismissile
Thanks, I will do that and use the repeater control. I saw u can make it quite speedy when disabling viewstate. And it will be the only updatepanel in the page so guess it will be ok yeah. Thanks and Take care
Mark
Here is a quick example of the paging using Transact-SQL:;WITH Contacts_CTE AS( SELECT Id, ROW_NUMBER() OVER(ORDER BY LastName) AS RowNum FROM Contacts)SELECT Id, FirstName, LastName FROM Contacts C INNER JOIN Contacts_CTE CTE ON C.Id = CTE.Id WHERE RowNum BETWEEN 1 AND 20You can easily create parameters to change the hardcoded 1 and 20 to use a PageIndex and PageCount variables.
Dismissile
Thanks man, got it to work. It has become pretty fast afterall.
Mark