Each time a Web page is sent to the server, a new instance of the Web page class is created. In traditional web programming, this usually means that in every round trip, all information associated with the page and the controls on the page is lost. For example, if a user enters information into a text box, that information is lost in a round trip from the browser or from the client device to the server.
State management is the process by which you maintain state and page information for multiple requests on the same page or on different pages. Like all HTTP-based technologies, WEB forms pages are stateless, meaning they do not automatically indicate whether the requests in the sequence are all from the same client, or whether a single browser instance has been viewing the page or site. In addition, each round trip to the server destroys and recreate the page, so if the life cycle of a single page is exceeded, the page information does not exist.
Client-based state management
View state
The ViewState property provides a Dictionary object that preserves values between multiple requests on the same page. This is the default method that pages use to preserve page and control property values between round trips.
When the page is processed, the current state of the page and control is hashed into a string and saved as a hidden field or multiple hidden fields in the page (if the amount of data stored in the ViewState property exceeds the specified value in the Maxpagestatefieldlength property). When the page is sent back to the server, the page analyzes the view-state string at the page initialization stage and restores the property information in the page.
Asp. NET State Management 11 (view state viewstate)
control state
Sometimes, you need to store control state data sequentially in order for the control to work correctly. For example, if you write a custom control that uses a different tab to display different information. In order for a custom control to work as expected, the control needs to know which tab is selected between round trips. You can use the ViewState property to do this, but developers can turn off view state at the page level, which makes the control work. To resolve this issue, the ASP.net page framework exposes a feature named control state in asp.net.
The ControlState property allows you to keep property information specific to a control and not be shut down like the ViewState property.
Asp. NET State Management 12 (control state controlstate)
Hidden fields
asp.net allows you to store information in a HiddenField control, which renders as a standard HTML hidden field. Hidden fields are not rendered visible in the browser, but you can set their properties just as you would a standard control. When a page is submitted to the server, the contents of the hidden field are sent along with the values of the other controls in the HTTP forms collection. A hidden field can be used as a repository for any page-specific information you want to store directly in a page.