Enabled / Disabled my control

Discussion in 'ASP .Net Building Controls' started by David, Apr 21, 2005.

  1. David

    David Guest

    Hi,

    My Control (inherits from System.Web.UI.Control) has the Enabled property
    that enabled a button inside of my control. The problem is that in the page
    that has the control has a button ("Edit") to set the Enabled property to
    true and when is pressed first load and build the control, and then the
    event handler of the edit button where set the Enabled property = true,
    then the Buttons inside the Control are not enabled.
    Somebody know some solution to that?

    Thanks!
     
    David, Apr 21, 2005
    #1
    1. Advertising

  2. David

    Guest

    The question does not make much sense and neither does your english. I
    would hazard a guess and say that this is a ViewState issue. In which
    case you need to realize that when a Control is enabled and disabled
    you have to be very careful on when you set properties as they may not
    be set in time to get put into the ViewState. Also if you have
    overridden the Enabled property of your control then you may have other
    issues that are effecting the aforementioned behavior.
     
    , Apr 21, 2005
    #2
    1. Advertising

  3. David

    David Guest

    Ok, my english isn't good, I'll try to explain me again.
    I want to set the property ActiveButtons from mi control to true, when the
    button "Active_Buttons", on the page container of my control, is clicked,
    but... first load myControl then load the page and finally the event-handler
    of "Active_Buttons" where set the property ActiveButtons to true, the
    problem is that the controls is already constructed when the property is
    setted and the change is showed in the next PostBack.




    "" <> wrote in message
    news:...
    > The question does not make much sense and neither does your english. I
    > would hazard a guess and say that this is a ViewState issue. In which
    > case you need to realize that when a Control is enabled and disabled
    > you have to be very careful on when you set properties as they may not
    > be set in time to get put into the ViewState. Also if you have
    > overridden the Enabled property of your control then you may have other
    > issues that are effecting the aforementioned behavior.
    >
     
    David, Apr 22, 2005
    #3
    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. Simon Brown
    Replies:
    1
    Views:
    4,369
    DWinter
    Aug 8, 2003
  2. Dennis Johansson
    Replies:
    1
    Views:
    512
    Dennis Johansson
    Aug 21, 2003
  3. Gabor
    Replies:
    3
    Views:
    660
    Jacob Yang [MSFT]
    Aug 26, 2003
  4. =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=
    Replies:
    2
    Views:
    6,556
    rick74
    May 27, 2008
  5. David

    Enabled / Disabled my control

    David, Apr 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    114
    Kannan.V [MCSD.net]
    Apr 25, 2005
Loading...

Share This Page