Difference between Control's ViewState and ControlState?

Discussion in 'ASP .Net' started by Edward, May 12, 2008.

  1. Edward

    Edward Guest

    I am reading MSDN doc about Control's ViewState and ControlState. I got
    myself quite puzzled. I see that the Control class has four virtual
    functions:

    LoadControlState
    LoadViewState
    SaveControlState
    SaveViewState

    But a Control has only ViewState property but no ControlState.

    Can anyone clarify on the difference between Control's ViewState and
    ControlStae?

    Thanks.
     
    Edward, May 12, 2008
    #1
    1. Advertising

  2. Edward

    Manish Guest

    Hi,

    you can refer to following two links for detailed information about the
    Control state and ViewState of the control. You can disable the Viewstate of
    the control but not the Controlstate. controlstate is also stored in the
    Hidden Field in HTML under_viewstate.

    Behavioral state for a control should be kept in control state, and UI state
    (its contents) should be kept in view state.

    http://www.pluralsight.com/blogs/fritz/archive/2004/07/01/472.aspx

    http://msdn.microsoft.com/en-us/library/1whwt1k7.aspx

    Regards,
    Manish
    www.ComponentOne.com

    "Edward" wrote:

    > I am reading MSDN doc about Control's ViewState and ControlState. I got
    > myself quite puzzled. I see that the Control class has four virtual
    > functions:
    >
    > LoadControlState
    > LoadViewState
    > SaveControlState
    > SaveViewState
    >
    > But a Control has only ViewState property but no ControlState.
    >
    > Can anyone clarify on the difference between Control's ViewState and
    > ControlStae?
    >
    > Thanks.
    >
     
    Manish, May 12, 2008
    #2
    1. Advertising

  3. Edward

    Edward Guest

    Thanks.

    Manish wrote:
    > Hi,
    >
    > you can refer to following two links for detailed information about the
    > Control state and ViewState of the control. You can disable the Viewstate of
    > the control but not the Controlstate. controlstate is also stored in the
    > Hidden Field in HTML under_viewstate.
    >
    > Behavioral state for a control should be kept in control state, and UI state
    > (its contents) should be kept in view state.
    >
    > http://www.pluralsight.com/blogs/fritz/archive/2004/07/01/472.aspx
    >
    > http://msdn.microsoft.com/en-us/library/1whwt1k7.aspx
    >
    > Regards,
    > Manish
    > www.ComponentOne.com
    >
    > "Edward" wrote:
    >
    >> I am reading MSDN doc about Control's ViewState and ControlState. I got
    >> myself quite puzzled. I see that the Control class has four virtual
    >> functions:
    >>
    >> LoadControlState
    >> LoadViewState
    >> SaveControlState
    >> SaveViewState
    >>
    >> But a Control has only ViewState property but no ControlState.
    >>
    >> Can anyone clarify on the difference between Control's ViewState and
    >> ControlStae?
    >>
    >> Thanks.
    >>
     
    Edward, May 12, 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. jakk
    Replies:
    4
    Views:
    12,225
  2. =?Utf-8?B?UGF2YW4=?=
    Replies:
    0
    Views:
    478
    =?Utf-8?B?UGF2YW4=?=
    Dec 7, 2005
  3. Mark Olbert
    Replies:
    5
    Views:
    653
    Steven Cheng[MSFT]
    Feb 1, 2007
  4. bill
    Replies:
    1
    Views:
    494
    news.microsoft.com
    Dec 7, 2007
  5. Pavan
    Replies:
    0
    Views:
    133
    Pavan
    Dec 7, 2005
Loading...

Share This Page