Controlstate confusion

Discussion in 'ASP .Net Building Controls' started by r.vries, Dec 26, 2007.

  1. r.vries

    r.vries Guest

    Hi,

    I'm just starting with asp.net and created a toolbar (custom) control.

    Everything works fine but when I do a postback a pushed button gets
    'the 'unpushed' state...

    I'm using LoadControlState and SaveControlState but the events aren't
    fired in the order I thought they would.

    Postback occured
    -LoadControlState fired
    -SaveControlState fired

    This explains why my button loses its state after a postback.

    But why is the state loaded before it is saved?

    Best regards,
    Ron
    r.vries, Dec 26, 2007
    #1
    1. Advertising

  2. r.vries

    r.vries Guest

    ps. I solved 'the pushed button' issue with a hidden field, so I'm not
    looking for a solution. :)
    But I'm just a bit confused by the behaviour of saving and loading the
    controlstate.
    r.vries, Dec 26, 2007
    #2
    1. Advertising

  3. r.vries

    Teemu Keiski Guest

    Hi,

    control state is saved initially on the first request when you load the
    page. Then on postback, it is first loaded back (on the server) , used in
    the process of dealing with the request (in respect to the control), and
    then again finally saved for the next postback (containing possible
    changes).

    --
    Teemu Keiski
    AspInsider, ASP.NET MVP
    http://blogs.aspadvice.com/joteke
    http://teemukeiski.net

    "r.vries" <> wrote in message
    news:...
    > ps. I solved 'the pushed button' issue with a hidden field, so I'm not
    > looking for a solution. :)
    > But I'm just a bit confused by the behaviour of saving and loading the
    > controlstate.
    Teemu Keiski, Jan 14, 2008
    #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. =?Utf-8?B?UGF2YW4=?=
    Replies:
    0
    Views:
    467
    =?Utf-8?B?UGF2YW4=?=
    Dec 7, 2005
  2. kelly

    asp.net ControlState

    kelly, Jul 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    kelly
    Jul 24, 2006
  3. Mark Olbert
    Replies:
    5
    Views:
    644
    Steven Cheng[MSFT]
    Feb 1, 2007
  4. bill
    Replies:
    1
    Views:
    479
    news.microsoft.com
    Dec 7, 2007
  5. Edward
    Replies:
    2
    Views:
    586
    Edward
    May 12, 2008
Loading...

Share This Page