Enabled = False disables controls on all pages. Why?

Discussion in 'ASP .Net Web Controls' started by Bisser Milanov, Jul 13, 2003.

  1. 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 rememberd the state of the textbox from the
    previous loaded page. Why?
     
    Bisser Milanov, Jul 13, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabor
    Replies:
    3
    Views:
    660
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. =?Utf-8?B?Sm9obiBOaW5hbg==?=

    PreRender Disables the User controls events

    =?Utf-8?B?Sm9obiBOaW5hbg==?=, Sep 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    544
    Martin Dechev
    Sep 24, 2004
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,224
    Smokey Grindel
    Dec 2, 2006
  4. elaine
    Replies:
    2
    Views:
    468
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    May 24, 2007
  5. Karen Grube
    Replies:
    0
    Views:
    150
    Karen Grube
    Nov 24, 2004
Loading...

Share This Page