This code add last row in the Table . I mean just last record get displayed I thought its a problem of viewstate so tried to EnableViewState but it says that its not like that
Employee emp = new Employee();
Table tb = new Table();
TableRow tr1 = new TableRow();
TableCell tc1 = new TableCell();
TableCell tc2 = new TableCell();
TableCell tc3 = new TableCell();
for(int i=0;i<7;i++){
emp = con.GetNextEmployee();
if (emp != null)
{
tc1.Text = emp.name;
tc2.Text = emp.position;
tc3.Text = emp.ext;
tr1.Cells.Add(tc1);
tr1.Cells.Add(tc2);
tr1.Cells.Add(tc3);
tb.Rows.Add(tr1);
}
}
Panel1.Controls.Add(tb);
Kindly help me