Hi,
How about this code:
for (int i = 0; i < 9; i++)
{
TableRow tr = new TableRow();
TableCell tc = new TableCell();
CheckBox chkCheckBox = new CheckBox
chkCheckBox .Attributes.Add("runat", "Server");
chkCheckBox .EnableViewState = true;
chkCheckBox .ID = "chkCheckBox " + i;
tc.Controls.Add(chkCheckBox );
tr.Cells.Add(tc);
table.Rows.Add(tr);
}
Thanks and Regards,
manish bafna
"James Wong" wrote:
> Dear Sir,
>
> I want to create some dynamic checkbox controls into the table.
> How can I get these controls after the form is submitted.
> -----------------------------------------------------
> e.g.
> For i = 1 to 9
> trwRow = New TableRow
> chkCheckBox = New CheckBox
> chkCheckBox.ID = "c" + CStr(i)
> tclCell = New TableCell
> tclCell.Controls.Add(chkCheckBox)
> trwRow.Cells.Add(tclCell)
> Next
> -----------------------------------------------------
> Thanks!
>
> James
>
>
>
>
|