Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting controls created 'on the fly' into a Div

Status
Not open for further replies.

markknowsley

Programmer
Aug 30, 2005
152
GB
I create a div that displays a bordered rectangle in the center of the web browser.

Within this rectangle I want to create a number of web controls. I'm not sure how many because I want the user to decide - their input on the previous page will determine how many of the controls are created.

So I pick up the number (let's say 2) and then do:

for (i = 0; i < 2; i++)
{
Label mylabel = new Label();
mylabel.ID = "mylabel" + i;
(add some more attributes)
form1.Controls.Add(mylabel);
}

How can I get these controls which are created as part of the PageLoad event on my web form to appear inside the div? Even better, how can I put them into a table which then appears inside the div?

Thanks in advance,

Mark
 
That would really be a question for the javascript forum then (forum216). I doubt you are having problems writing out div and table tags.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top