Efficient Data Paging with the ASP.NET 2.0 DataList Control and ObjectDataSource
page 4 of 5
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 48433/ 87

Summary

Because we only retrieve and return the rows needed for the current page of rendering from the database, and because we only use a single database call to retrieve all of the data for the product-listing page, the execution of the page should be very, very fast and scalable (even when you have thousands of results).  As you can see above, the code to implement this is pretty small and clean. 

Because we are using standard navigational HTTP GET requests everywhere in the sample, no client-script is needed or emitted on the page (do a view-source in the browser and you’ll notice there isn’t a single line of javascript anywhere on the page). All markup in the sample is also XHTML compliant and cross-browser.

I used FireFox for all the screen-shots above – but obviously it also works with IE.

Hope this helps,

Scott


View Entire Article

User Comments

Title: That great but,   
Name: Quoc Thinh
Date: 2007-08-17 11:42:53 PM
Comment:
There are two thing, first SQL 2000 don't have ROW_NUMBER, and the second if the results has too many pages, and the pager should be, for example 10 page per view then when click Next, it show next 10 pager. So is there any solution for it, and even if you could this should use AJAX.
Thank very much
Title: That great but,   
Name: Quoc Thinh
Date: 2007-07-01 11:06:28 AM
Comment:
There are two thing, first SQL 2000 don't have ROW_NUMBER, and the second if the results has too many pages, and the pager should be, for example 10 page per view then when click Next, it show next 10 pager. So is there any solution for it, and even if you could this should use AJAX.
Thank very much
Title: Use the New keyword to create the instance.   
Name: Gary
Date: 2007-05-05 7:58:24 PM
Comment:
Great article Scott, but line 15 in Products.aspx.cs throws the error: "Use the New keyword to create an object instance."

I'm trying to work it out but I'm pretty new to C#.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-11-24 6:54:39 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search