Persisting State Information

Discussion in 'ASP .Net' started by Charlie, Mar 6, 2004.

  1. Charlie

    Charlie Guest

    Hi,

    Is there a way of persisting state information for a server control
    without using ViewState? I'm currently using Page.Session() but I
    don't think this is the best way. What's the preferred method?

    Thanks
    Charlie
     
    Charlie, Mar 6, 2004
    #1
    1. Advertising

  2. Charlie

    Natty Gur Guest

    Hi,

    Yes, you can change the default behavior by overriding
    SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium.
    here a sample that preserve viewstate into session data collection :

    protected override void SavePageStateToPersistenceMedium(
    object viewState)
    {
    Session["VS"] = viewState;
    }

    protected override object LoadPageStateFromPersistenceMedium()
    {
    return Session["VS"];
    }

    Just keep in mind that such a solution reduce network traffic but demand
    to save ViewState data in centralize place to support load balancing
    scenarios.

    HTH

    Natty Gur[MVP]

    blog : http://weblogs.asp.net/ngur
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Natty Gur, Mar 7, 2004
    #2
    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. Charlie

    Persisting State Information

    Charlie, Mar 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    337
    Charlie
    Mar 7, 2004
  2. Shawn McNiven

    Persisting Information across forms

    Shawn McNiven, Apr 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    404
    Richard Saunders
    Apr 7, 2004
  3. =?Utf-8?B?a2VuIGJ1cw==?=

    Method for persisting all page state not just viewstate.

    =?Utf-8?B?a2VuIGJ1cw==?=, Jul 12, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    630
    =?Utf-8?B?a2VuIGJ1cw==?=
    Jul 24, 2004
  4. yoshibebe
    Replies:
    1
    Views:
    575
    John M Deal
    Nov 23, 2004
  5. Chris  Ashley
    Replies:
    4
    Views:
    784
    Mr Newbie
    Sep 21, 2005
Loading...

Share This Page