I am dynamically generating checkbox for button1 click and
dynamically generating textbox for button2 click.

But my problem is if button2 is clicked then texbox gets generated BUT
CHECKBOX GETS DISAPPEARED.
similarly if button1 is clicked then checkbox gets generated BUT
TEXTBOX GETS DISAPPEARED.

So when i click button2 i want textbox to be generated and also i want the
checkbox which were generated for button1 click to be preserved
AND VICEVERSA.

My code is as follows

--------------------------------------------------------------------------
private void Button1_Click(object sender, System.EventArgs e)
{
int n= Convert.ToInt32(DropDownList1.SelectedItem.Text);
for(int i=0;i<n;i++)
{
CheckBox chk= new CheckBox();
chk.ID=chk+i.ToString();
chk.Height=20;
chk.Width=10;
chk.Visible= true;
Form1.Controls.Add(chk);

}
}

private void Button2_Click(object sender, System.EventArgs e)
{
int m= Convert.ToInt32(DropDownList2.SelectedItem.Text);
for(int i=0;i<m;i++)
{
TextBox txt= new TextBox();
txt.ID=txt+i.ToString();
txt.Height=20;
txt.Width=50;
txt.Visible= true;
Form1.Controls.Add(txt);
}

}






--------------------------------------------------------------------------

Thanks