Session("counter") vs. ViewState("counter")...a newbie question

Discussion in 'ASP .Net' started by The Eeediot, Dec 22, 2004.

  1. The Eeediot

    The Eeediot Guest

    Okay, I'm going to take one more kick at this dead horse to see if I understand this stuff.

    · Session("counter") store this information on the web server (i.e. server side) and can be accessed by any pages within the web application.

    · ViewState("counter") stores this information on the page (i.e. client side) and is only accessible within that individual page.

    Am I missing anything?

    ===========
    I have a mind like a steel trap...the trouble is getting it open!
    The Eeediot, Dec 22, 2004
    #1
    1. Advertising

  2. The Eeediot

    Marina Guest

    Everything you said is true.

    Also, there are other considerations. Store too many things in your ViewState, and your pages become bloated and slow. Store too many in session state, and with many users you get low on memory.

    Restart your web app or reboot your machine, and you lose your session state info, unless you are using sql server.
    "The Eeediot" <> wrote in message news:...
    Okay, I'm going to take one more kick at this dead horse to see if I understand this stuff.

    · Session("counter") store this information on the web server (i.e. server side) and can be accessed by any pages within the web application.

    · ViewState("counter") stores this information on the page (i.e. client side) and is only accessible within that individual page.

    Am I missing anything?

    ===========
    I have a mind like a steel trap...the trouble is getting it open!
    Marina, Dec 22, 2004
    #2
    1. Advertising

  3. You seem to have the basic idea down.

    "The Eeediot" <> wrote in message
    news:...
    Okay, I'm going to take one more kick at this dead horse to see if I
    understand this stuff.

    · Session("counter") store this information on the web server (i.e. server
    side) and can be accessed by any pages within the web application.

    · ViewState("counter") stores this information on the page (i.e. client
    side) and is only accessible within that individual page.

    Am I missing anything?

    ===========
    I have a mind like a steel trap...the trouble is getting it open!
    Peter Rilling, Dec 22, 2004
    #3
  4. Add one thing: ViewState is used for postback. So everything is gone if you
    refresh page.
    =?Utf-8?B?UnVsaW4gSG9uZw==?=, Dec 22, 2004
    #4
    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. Ben Rush
    Replies:
    2
    Views:
    522
    Ben Rush
    Dec 5, 2003
  2. Steph
    Replies:
    2
    Views:
    1,660
    heislord5
    May 11, 2011
  3. =?Utf-8?B?aGF6eg==?=
    Replies:
    2
    Views:
    555
    =?Utf-8?B?aGF6eg==?=
    Apr 11, 2005
  4. ProvoWallis

    Newbie Class/Counter question

    ProvoWallis, Mar 15, 2006, in forum: Python
    Replies:
    3
    Views:
    286
    Michael Spencer
    Mar 15, 2006
  5. George2
    Replies:
    1
    Views:
    795
    Alf P. Steinbach
    Jan 31, 2008
Loading...

Share This Page