state management in a custom control

Last post 06-26-2009 6:57 PM by Ambran. 1 replies.

Sort Posts:

  • state management in a custom control

    06-26-2009, 3:58 PM
    • Member
      point Member
    • dsteveso
    • Member since 11-09-2007, 3:52 PM
    • Posts 1

    Hello,

    I am currently modifying a custom control I created awhile ago.  When looking at some other examples of viewstate I wondered if I did it correctly.  I overrode the SaveViewState and LoadViewState methods.  It looks like I could have just used ViewState["key"] to store everything.  Are there any benefits / disadvantages to using LoadViewState / SaveViewState over ViewState["key"]?

    Filed under:
  • Re: state management in a custom control

    06-26-2009, 6:57 PM
    Answer
    • Participant
      1,411 point Participant
    • Ambran
    • Member since 03-18-2009, 2:23 PM
    • Denmark
    • Posts 273

    Hi

    I use ViewState["key"] regularly in order to save some data localy until page returns.

    I usualy create a constant for every key so I get better control of the keys that are sometimes spread throughout the page.

    I try not to overload ViewStates with data in order for the page not to be too heavy.

    ViewState["key"] works fine for me. Never manipulated with the SaveViewState and LoadViewState.

    Amit

    If this post was of any help to you, Mark it as Answer for the benefit of others, Thanks.

    Spread Firefox Firebug - Web Development EvolvedMom's online gallery Mom's grafical oasis
Page 1 of 1 (2 items)