Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 117,695 times

Contents

Related Categories

Custom ASP.NET Datagrid Paging With Exact Count - Introduction

DMarko1

Introduction

Anybody in the DB world knows what paging database results is and its effect. From the time I had started getting into good old classic ASP, I was intrigued with the ability to divide large sets of data into sections of x records per page. One thing that I didn't like about paging is that it seemed sites incorporated just a < Prev and Next > link on the search results page. I wasn't satisfied with such a lackluster paging technique, and from there I searched high and low on every ASP Web site I could find to see if there was code to show more advanced paging options, such as how many pages were remaining to be paged through, or, if the next page was the last page of results, how many records were on that last page. Unfortunately, I couldn't find any such code, so I had set out to do it myself. (To see the proposed paging enhancements I like, check out the live demo for this article...)

I have since coded a number of techniques for advanced paging in classic ASP, but my latest challenge has been to incorporate the same paging techniques in ASP.NET! (For more information on ASP.NET, be sure to visit the ASP.NET Article Index.) Pssst, don't ask me to talk about redoing my app in Beta 1, and upon upgrading to Beta 2 was horrified that my code needed to be redone.... by the way, the code in this article is all Beta 2 compliant.

Now, if anyone has looked into the Microsoft .NET SDK and Quickstart samples you will find custom paging samples, but it's the usual next and prev stuff. Now let's see how we can kick this paging up a notch and tell us more detail about our data output.

This article was originally published on 4guysfromrolla.com.

Dimitrios, or Jimmy as his friends call him, is a .NET developer/architect who specializes in Microsoft Technologies for creating high-performance and scalable data-driven enterprise Web and desktop applications. Till now Jimmy has authored nearly two dozen .NET articles, published on Dot Net Junkies, 4 Guys From Rolla, Sitepoint, MSDN Academic Alliance, Developers.NET, The Official Microsoft ASP.NET Site, and here on Developer Fusion, covering various unique and advanced techniques on .NET.

Comments

  • Posted by DMarko1 on 08 Jul 2005

    Hi, thanks, I appreciate your compliments.

    I have written another older article that I think should help. It's entitled- [url="http://www.sitepoint.com/article/datagrid-searching-asp-net"]Drilldown...

  • About Custom Paging

    Posted by jmawebco on 08 Jul 2005

    I loved your article on custom paging but would very much like to know how to apply it when you filter your initial data set to retreive specific records. I have a grid with 813 records sorted by user...

  • Paging with exact count and large datasets.

    Posted by mcslayton on 26 Oct 2003

    [url="http://www.seasidecon.com/arsnet/"]Check this site...[/url]

    I too was on the same quest and I've created a best practices reference site that covers many enterprise topics necessary to creat...

  • Posted by Grumly on 17 Oct 2003

    Hello,

    Tankete, I just have try what you are asking for a couple of days ago :

    The principe is simple : returning only a needed page from 50th to 60th records consists in querying this way :

    ...

  • What about large datasets?

    Posted by tankete on 16 Oct 2003

    I was hoping that you would address how to do paging with exact counts while NOT returning the entire dataset from the database, just the current page worth of data. Can you provide any information on...