M
margelos
I am building a web page dynamic by creating a large number of
controls, depending on data return by database,
lets say about 1500 controls (1000 asptextboxes, 500 checkboxes) and i
NEED to have them as server controls and not
simple html inputs. The way that i am creating this control goes like
that:
Table tbl = new Table();
tbl.CssClass = "OddsTable";
tbl.ID = "TAKETABLE_" + myRow["ID"].ToString() + "_GO";
tbl.CellPadding = 0;
tbl.CellSpacing = 0;
TableRow tr = new TableRow();
TableCell upcell = new TableCell();
TextBox oBox = new TextBox();
oBox.ID = "XXX_" + myRow["ID"] + "EEE";
upCell.Controls.Add(OBox);
tr.Cells.Add(upCell);
tbl.Rows.Add(tr);
and so on for all the data i have. This is a sample, i don't create a
table for every textbox, anyway. As you can understand my page is very
slow
Postback makes about 7-8 secs, cause every time it should be redraw
itself. Why you think it is so slow and is there anything i can do?
- because of so many controls? (which is the one i believe)
- The way i am building the page? Create table, row , cell, textbox add
it and so on...
Thanks in advance
controls, depending on data return by database,
lets say about 1500 controls (1000 asptextboxes, 500 checkboxes) and i
NEED to have them as server controls and not
simple html inputs. The way that i am creating this control goes like
that:
Table tbl = new Table();
tbl.CssClass = "OddsTable";
tbl.ID = "TAKETABLE_" + myRow["ID"].ToString() + "_GO";
tbl.CellPadding = 0;
tbl.CellSpacing = 0;
TableRow tr = new TableRow();
TableCell upcell = new TableCell();
TextBox oBox = new TextBox();
oBox.ID = "XXX_" + myRow["ID"] + "EEE";
upCell.Controls.Add(OBox);
tr.Cells.Add(upCell);
tbl.Rows.Add(tr);
and so on for all the data i have. This is a sample, i don't create a
table for every textbox, anyway. As you can understand my page is very
slow
Postback makes about 7-8 secs, cause every time it should be redraw
itself. Why you think it is so slow and is there anything i can do?
- because of so many controls? (which is the one i believe)
- The way i am building the page? Create table, row , cell, textbox add
it and so on...
Thanks in advance