One of the key goals of ASP. NET is to create a pattern that allows developers to quickly customize web forms like Windows application developers customize desktop applications. Of course, web applications are very different from traditional rich client applications, and there are two key obstacles to achieving this mode.
1. Web applications are executed on the server: for example, create a form that allows users to select a product record and update its information. The user executes these tasks in the browser, but in order to perform these necessary operations (such as updating data), the Code must be executed on the Web server. ASP. NET uses a technology called return to process this separation. When some actions are executed, it sends webpages (including information provided by all users) to the server. Once ASP. NET receives this webpage, it can trigger corresponding server events to corresponding code.
2. The web application is stateless: in other words, before the HTML page presented to the user is sent to the user, the object of the web page is cleared and all the information specified by the client is disabled. This mode is suitable for applications with high scalability and busy network communication. However, this makes it difficult for him to create a seamless user experience. ASP. NET contains several tools to help us eliminate these shortcomings. The most famous is the persistence mechanism called view state, which can automatically embed information about webpages in the hidden domain that is presented to the user's HTML.