Thursday, July 30, 2009

How can I do this in ASP?

Hello,


I have 1000 records in the database table. I know how to handle databases and how to view a column in a table. My problem is: how can I list the database data with Pages?





I want to include 10 records per page, Next and Previous buttons. What is the trick?

How can I do this in ASP?
Databind to a datagrid. Right click on the datagrid. Turn paging and sorting on. Set paging to 10 records.
Reply:You shouldn't use the default paging method if you're talking about 1000 records. The problem with default paging is that each time the page is sent, all of the records are sent. Your page will be very slow sending down 1000 records each and every time. It would be better to use custom paging. There is a very good article about this at:





http://aspnet.4guysfromrolla.com/article...





It's more work, but your page will be 100x faster (since you'll only send down 10 records instead of 1000).


No comments:

Post a Comment