DataPager in .Net 3.5

Pagination is something we face eachtime when we build a web application. My project needed some kind of paging functionality last week and we were evaluating various options. I hate SQL Server for one reason and embrace MySQL for the ANSI defying LIMIT clause.

Pagination in MySQL is simply fun. Just say LIMIT starting record number,items per page and Voila you get the wanted result set.

Pagination in SQLServer is not that easy.You can however achieve paging using some work arounds like ROWORDER and ROWCOUNT in SQL Server

You need to be passing around the PrimaryKey and must sort the data based on the key for the pagination.You need to add a Numeric Primary Ke if your schema does not have one.

DataPager is a brilliant new Pagination Control available since .Net 3.5.

You can use it with the Repeater Control or the new ListView Control.

Its not like the DataGrid which uses tables for the markup. You can use  it with Divs.

I was playing with Microsoft Visual Web Developer 2008 Beta 2 when i found this control.

Head over here for a nice example 

Exit mobile version