What is the difference between View State, Session State and Hidden Variables?In which scenario we use each of them?

Questions by hsarvani

Showing Answers 1 - 9 of 9 Answers

jayareddy12

  • Sep 26th, 2007
 

Hidden Files contain information that is not visible on the page but is posted to the server along with a page post back While View State is the mechanism that asp.net uses to maintain the state of controls across page post backs.

  • HiddenFiles are used for pages that post to themselves or to other pages while View State works only when a page posts back to itself.
  • Hidden Files does not support for storing structured values while View State support for structured values.
    Whereas Session values are available only for the duration of current browser Session only.
  •   Was this answer useful?  Yes

    View state variables stores the value for a single page, it a client side browser, session is a server side variables. It stores the value for the full project.

      Was this answer useful?  Yes

    View state is stored on page(base 64 encoded). In addition a hash is created using MAC key which is added to view state data and resulting string is stored on page.

    Hidden variables doesn't render visibly in browser but its properties can be set. When page is submitted to server, contents of hidden field is sent in http form

    Session state is a server based state management. It can be accessible from all pages in web application. It is scoped to current browser session only. It's structured as a key/value dictionary for storing session specific info that needs to be maintained between server round trips.

    Give your answer:

    If you think the above answer is not correct, Please select a reason and add your answer below.

     

    Related Answered Questions

     

    Related Open Questions