protected void chk1_CheckedChanged(object sender, EventArgs e) { if (chk1.Checked) { int a = 1; for (; a <= 6; a++) { CheckBox chklst1 = new CheckBox(); chklst1.ID = "med_chk" + a; panl1.Controls.Add(chklst1); Literal li2 = new Literal(); li2.Text = ""; panl1.Controls.Add(li2); } } }
<form id="form1" runat="server"> <asp:Panel ID="panl1" runat="server"> <asp:CheckBox ID="chk1" runat="server" Text="hai" oncheckedchanged="chk1_CheckedChanged"> </form>
<asp:checkbox id="chk1" runat="server" text="hai" oncheckedchanged="chk1_CheckedChanged" autopostback="true" xmlns:asp="#unknown" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)