Click here to Skip to main content
15,894,249 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have done paging using view state. but we have other choice such as caching,session .So which one best in performance?
Posted
Comments
Mehdi Gholam 3-Sep-15 5:39am    
It depends on the use-case.

1 solution

Neither are good ways to do paging, but of the options you have listed use viewstate. When you put your results in the session or cache then those results exists in the server's memory until they are removed. If you store the data in the viewstate it is stored on the client and only exists while the user is on that page. If they navigate elsewhere the data is gone.

It is far better to implement paging at the data store level...so if your data is in SQL then make sure SQL only returns the results you need, so results 11 to 20 if you are on page 2, for example. Google paging with SQL for various techniques that let you do this.
 
Share this answer
 
Comments
Suvendu Shekhar Giri 3-Sep-15 6:40am    
5ed !
Arasappan 3-Sep-15 8:10am    
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900