dynamically generate controls on an asp page

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.
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top