newbie: Dynamically added controls are lost after postback

  • Thread starter Thread starter NotYetaNurd
  • Start date Start date
N

NotYetaNurd

Hi ,
Am very new to asp.net
i did somethign like this

CheckBox cbox = new CheckBox();
cbox.Text=txtTask.Text;
MainPnl.Controls.Add(cbox);

and when i call the same routine again the checkboxes are replaced with the
new ones...

regards,
.....
 
NotYetaNurd said:
Hi ,
Am very new to asp.net
i did somethign like this

CheckBox cbox = new CheckBox();
cbox.Text=txtTask.Text;
MainPnl.Controls.Add(cbox);

and when i call the same routine again the checkboxes are replaced with the
new ones...

You have to instantiate and add the dynamic controls on every request.
 
Back
Top