B
Bisser Milanov
I have
1. A main form with 2 buttons (btn1 and btn2) and a place holder (ph)
2. A Web User Control (ctl1) containing a textbox (txt)
3. A Web User Control (ctl2) containing a textbox (txt)
When I press btn1 I have the following code:
ph.Controls.Add(LoadControl("ctl1.ascx"))
When I press btn2 I have the following code:
ph.Controls.Add(LoadControl("ctl2.ascx"))
In ctl1 I have the following line on form load:
txt.Enabled = False
When I press btn1 ctl1 is loaded and the txt is disabled. When I press btn2
ctl2 is loaded and the txt is disabled. Why the txt on ctl2 is disabled? and
how can I avoid it? Somehow it remembered the state of the textbox from the
previous loaded page. Why?
1. A main form with 2 buttons (btn1 and btn2) and a place holder (ph)
2. A Web User Control (ctl1) containing a textbox (txt)
3. A Web User Control (ctl2) containing a textbox (txt)
When I press btn1 I have the following code:
ph.Controls.Add(LoadControl("ctl1.ascx"))
When I press btn2 I have the following code:
ph.Controls.Add(LoadControl("ctl2.ascx"))
In ctl1 I have the following line on form load:
txt.Enabled = False
When I press btn1 ctl1 is loaded and the txt is disabled. When I press btn2
ctl2 is loaded and the txt is disabled. Why the txt on ctl2 is disabled? and
how can I avoid it? Somehow it remembered the state of the textbox from the
previous loaded page. Why?