01.
int
i;
02.
Label lblNum,lblBr;
03.
TextBox txtQuan, txtUnit, txtAmount;
04.
DropDownList DDLDetailList;
05.
for
(i = 1; i <= Convert.ToInt32(
this
.ddlNum.SelectedItem.Value); i++)
06.
{
07.
lblBr =
new
Label();
08.
lblBr.Text =
"<br /><br /><br />"
;
09.
10.
txtQuan =
new
TextBox();
11.
txtQuan.ID =
"Quan"
+ i;
12.
txtQuan.Width = 20;
13.
14.
DDLDetailList =
new
DropDownList();
15.
DDLDetailList.ID =
"Detail"
+ i;
16.
17.
lblNum =
new
Label();
18.
lblNum.Text = Convert.ToString(i);
19.
20.
txtUnit =
new
TextBox();
21.
txtUnit.ID =
"Unit"
+ i;
22.
23.
txtAmount =
new
TextBox();
24.
txtAmount.ID =
"Amoumt"
+ i;
25.
26.
this
.Panel1.Controls.Add(lblNum);
27.
this
.Panel1.Controls.Add(lblBr);
28.
29.
this
.Panel2.Controls.Add(lblBr);
30.
this
.Panel2.Controls.Add(DDLDetailList);
31.
32.
this
.Panel3.Controls.Add(txtQuan);
33.
this
.Panel3.Controls.Add(lblBr);
34.
35.
this
.Panel5.Controls.Add(txtUnit);
36.
this
.Panel5.Controls.Add(lblBr);
37.
38.
this
.Panel6.Controls.Add(txtAmount);
39.
this
.Panel6.Controls.Add(lblBr);