Add control to panel Runtime
-
I would like to add a control to a panel during runtime; this is what im doing TextBox str = new TextBox(); str.id = Test; str.Width = Unit.Pixel(100); str.Height = Unit.Pixel(100); this.Panel3.Controls.Add(str); to my suprise this conrol is not being added; does anyone know whats wrong with this code;
-
I would like to add a control to a panel during runtime; this is what im doing TextBox str = new TextBox(); str.id = Test; str.Width = Unit.Pixel(100); str.Height = Unit.Pixel(100); this.Panel3.Controls.Add(str); to my suprise this conrol is not being added; does anyone know whats wrong with this code;
What event are you adding the control in? Page_Load Be careful where the controls are you have to take in to account postback A good article to read would be on Page Life Cycle
Deliver yesterday, code today, think tomorrow. "http://www.heuse.com/cphumor.htm"
-
What event are you adding the control in? Page_Load Be careful where the controls are you have to take in to account postback A good article to read would be on Page Life Cycle
Deliver yesterday, code today, think tomorrow. "http://www.heuse.com/cphumor.htm"