dynamically generate controls on an asp page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have 2 scenarios:
First, an aspx page that contains 300 controls with the labels of course in
a table.

Second, an empty aspx page that contains on loading a script that creates
the 300 controls dynamically.

On every open of the page for reading, the system will fetch data from SQL
and draw the 300 labels with the corresponding data and On every edit of the
page the system will also draw the 300 label with 300 controls and display
the data.

I would like to know first, is creating the 300 control visually by drag and
drop (scenario 1) , is the same as creating the controls by script (scenario
2)?

How are things translated internally when a user requests a page?

thx.
 
control placed on the form generate code like

TextBox1 = new TextBox();
TextBox1.CssClass = "myClass";
....

this code is executed on every page render and postback. so you should see
no difference unless you loop logic is real slow, or your sqlquery is real
slow.

but in your case 300 rows may be real slow to render by the browser.
generally 50 is the max. you might want to look at a paging model.



-- bruce (sqlwork.com)
 
Back
Top