tags:

views:

1337

answers:

2

I have an html table which i bind data dynamically on the server side in C#.. The problem is that I have a search button that calls a search on the DB(in a search method on the server side) based on the information from the client page. this search method loads the info from the DB and updates the html table(this is where the information is binded dynamically)

for (int i = 0; i < data.Count; i++)
{   
  FirstCell.Controls.Add(lbl1);

  SecondCell.Controls.Add(lbl2);

  ThirdCell.Controls.Add(lbl3);      
  row.Cells.Add(FirstCell);

  row.Cells.Add(SecondCell);

  row.Cells.Add(ThirdCell);

  Table.Rows.Add(row);
}

... and after this is done I store the loaded objects from the DB in a session variable like: Session{"data"]=data;

my question is how do I display the html table with a certain number of records per page with the page's indexes at the bottom of the view page below the table? And as I iterate through the pages keep the data viewable and not lost? I am not trying to use ASP.net data controls!!!

+1  A: 

I know this doesn't exactly answer your question, but doesn't the standard ASP.NET DataGrid support paging out of the box? Or do you not want to use ASP.NET controls. Just curious....

BFree
I do not want to use asp data controls...
TStamper
+1  A: 

Have you seen this post about how to implement client-side paging in a Gridview control using JQuery? There is an example of it in action here - Datagrid paging using JQuery example

This could be modified to work with a html table.

Russ Cam
@Russ What would I do without you..
TStamper