The response to change in the page content is enhanced through the use of ViewState. ViewState is how ASP.NET Web Forms take this customized approach and transfer state information between the browser and the server.
The ASP.NET lifecycle allows the developer to interact with information at various points in the HTML creation phase.
Page Request
This stage happens before the page-calling process starts. It is when the system determines whether run-time compilation is necessary, whether cached output can be returned, or whether a compiled page needs to be run.
Start
The page starts to do some processing on the HTTP request. Some base variables are initialized, such as Request, Response, and the UICulture.
Initialization - During this phase, the controls on the page are initialized and assigned their unique IDs. Master pages and themes are applied as applicable.
Load - if the request is a postback, control information is loaded with the information recovered from the view state.
Postback Event Handling - If the request is a postback, all the various controls fire their event handlers as needed. Validation also happens at this time.
Rendering - Before the rendering stage starts, ViewState is saved for the page and all of the controls as configured.
Unload - This happens after the content is created and sent to the client. Objects are unloaded from memory and cleanup happens.
PreInit - Raised after the start stage is complete and before the initialization stage begins. It is used to create or recreate dynamic controls, setting master pages or themes dynamically.
Init - This event is raised after all the controls have been initialized. It is used to initialize control properties.
InitComplete - Only one thing happens between Init and InitComplete, and that is the enabling of view state for the controls. Changes applied in this event and after will impact view state to make sure it will be available next postback.
PreLoad - Raised after the page manages the view state information for itself and all controls.
Load - The OnLoad method is called in a page, which then recursively calls that same method on every control.
Control Events - These are specific control-based events, such as the Click of a button, or TextChanged on a text box.
LoadComplete - This event is raised after all the event handling has occured.
PreRender - After all the controls have been loaded, the Page object starts its Prerender phase.
PreRenderComplete - Raised after every data-bound control has been bound.
SaveStateComplete - Raised after view state and control state have been saved for the page and for all controls.
Render - this is not an event. Rather, at this point in the process, the Page object calls this method on each control.
Unload - This is used to perform special cleanup activities, such as closing files or database connections, logging, etc.
HTML server controls - wrappers for traditional HTML elements.
Web server controls - tends to encompass more functionality and be more abstract than an HTML server control.
Validation controls - ensures that the values entered into other controls meet certain criteria, or are valid.
User controls - controls that you build yourself. If a set of functionality needs to be available on multiple pages, then it is most likely that you should create this functionality as a user control.
Web Forms Server Control
Add-ins to the markup section of the application, which are added to HTML documents. Elements added to an .aspx file used for displaying the properties, methods, and events that can be accessed by the code-behind file.