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. Advertisements

  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. Advertisements

  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. Advertisements

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. Henri
    Replies:
    2
    Views:
    1,907
    Henri
    May 18, 2004
  2. jakk
    Replies:
    4
    Views:
    13,786
  3. =?Utf-8?B?UGF2YW4=?=
    Replies:
    0
    Views:
    580
    =?Utf-8?B?UGF2YW4=?=
    Dec 7, 2005
  4. Santa
    Replies:
    1
    Views:
    1,418
    Mark A. Odell
    Jul 17, 2003
  5. Mark Olbert
    Replies:
    5
    Views:
    831
    Steven Cheng[MSFT]
    Feb 1, 2007
  6. bill
    Replies:
    1
    Views:
    624
    news.microsoft.com
    Dec 7, 2007
  7. Pavan
    Replies:
    0
    Views:
    226
    Pavan
    Dec 7, 2005
  8. PerlFAQ Server
    Replies:
    0
    Views:
    541
    PerlFAQ Server
    Jan 6, 2011
Loading...