I am working on a dynamic asp.net page, and ı generate some label and text box in my form page. But ı want to generate them in the specific div class. How can ı solve that problem?
Here is codes:
for (int i = 0; i < countStart; i++) //Create all content of the table in here
{
//CREATE ALL LABELS
Label lbl = new Label();
string colName = ds1.Tables[0].Rows[i]["COLUMN_NAME"].ToString(); //SET LABEL NAME LİKE TABLE COLUMN NAME
lbl.Text = colName;
lbl.ID = "lbl" + ds1.Tables[0].Rows[i]["COLUMN_NAME"].ToString() + i.ToString(); //SET LABEL ID LİKE TABLE COLUMN NAME PLUS İNT İ VALUE
form1.Controls.Add(lbl);
Label space = new Label(); space.Text = " "; form1.Controls.Add(space); //SPACE
//CREATE ALL TEXT BOES
TextBox textbox1 = new TextBox();
textbox1.ID = "txt" + i.ToString(); //SET TEXT BOX NAME
textbox1.Attributes.Add("colVal", colName); //SET NEW ATTRİBUTES TO TEXTBOX
textbox1.Width = 500;
form1.Controls.Add(textbox1);
}