Divide data into pages

How to split data into ASP.Net pages?

I'm looking for something like what Google does when you have too many search results and breaks them down into x number of pages.

+1


source to share


3 answers


This will depend entirely on the content. If it's a simple datagrid, you can use the built-in datagrid podcast. If the data is coming from SQL I would suggest creating a generic "paging control" and using the SQL paging functionality to only discard the data you want to see.

If it's a SQL 2005 swap (or higher) nice and easy:



SELECT  Description, Date
FROM     (SELECT  ROW_NUMBER() OVER (ORDER BY MyCol DESC) AS Row, Desc, Date FROM MyTable)
AS MyTableWithRowNumbers
WHERE  Row >= 1 AND Row <= 10

      

+5


source


For your best choices, the falling data or repeater will be displayed.



0


source


Use GridView and LinqDataSource.

He will do everything for you.

Cm:

http://msdn.microsoft.com/en-us/library/bb470363.aspx

and

http://msdn.microsoft.com/en-us/library/bb547113.aspx

0


source







All Articles