The reason behind this question lies in HTTP protocol. Strange but it’s true.
HTTP is a stateless protocol. Each request is serviced as it comes; after the request is processed, all of the data is discarded. No state is maintained across requests even from the same client. This would typically mean that all information associated with the page and the controls on the page would be lost with each round trip. For example, if a user enters information into a text box, that information would be lost in the round trip from the browser or client device to the server. Thus, a new instance of the Web page class is created each time the page is posted to the server.
ASP.NET includes several options that help you preserve data on both a per-page basis and an application-wide basis:
- Viewstate
- Control state
- Hidden fields
- Cookies
- Query strings
- Application state
- Session state