Session state vs. View state:
By in ASP.NET on Nov 30 2006
  • shankar kumar
    Feb, 2014 7

    View State: View state, which persists values in a page. View state is maintained in page level only. View state of one page is not visible in another page. View state information stored in client only. View state persist the values of particular page in the client (browser) when post back operation done. View state used to persist page-instance-specific data. (Read more) Session State: Session state is maintained in session level. Session state value is available in all pages within a user session. Session state information stored in server. Session state persist the data of particular user in the server. This data available till user close the browser or session time completes.

    • 1
  • Nov, 2006 30

    In some cases, using view state is not feasible. The alternative for view state is session state. Session state is employed under the following situations: Large amounts of data - View state tends to increase the size of both the HTML page sent to the browser and the size of form posted back. Hence session state is used. Secure data - Though the view state data is encoded and may be encrypted, it is better and secure if no sensitive data is sent to the client. Thus, session state is a more secure option. Problems in serializing of objects into view state - View state is efficient for a small set of data. Other types like DataSet are slower and can generate a very large view state.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS