What is the difference between viewstate and sessionstate?

Discussion in 'ASP' started by hireaspdeveloper, May 10, 2012.

  1. hireaspdeveloper

    hireaspdeveloper Banned

    Joined:
    Apr 26, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    ASP Developer
    Location:
    Lilburn
    Home Page:
    http://www.hireaspdeveloper.com/
    What is the difference between viewstate and sessionstate?
     
  2. anirban09p

    anirban09p Banned

    Joined:
    Aug 27, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    ViewState persist the values of controls of particular page in the client (browser) when post back operation done. When user requests another page previous page data no longer available.

    SessionState persist the data of particular user in the server. This data available till user close the browser or session time completes.
     
  3. alia123

    alia123 New Member

    Joined:
    Jan 8, 2016
    Messages:
    65
    Likes Received:
    5
    Trophy Points:
    0
    Hey,
    ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application.
    Session State contains information that is pertaining to a specific session with the server. It's a way to track what the user is doing on the site across multiple pages Cookies can be used for session state.
    View State on the other hand is information specific to particular web page. It is stored in a hidden field so that it isn't visible to the user. It is used to maintain the user's illusion that the page remembers what he did on it the last time but don’t give the exact page.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice