03 Handout 1 Flashcards
is part of the .NET infrastructure that provides a programming model and various services that are necessary to build up web applications.
ASP .NET Web Forms
What is the main benefit of ASP .NET Web Forms?
the level of abstraction that it provides compared to the request/response approach and the creation of the HTML that is sent to the client
The response to change in the page content is enhanced through the use of
ViewState
is how ASP.NET Web Forms take this customized approach and transfer state information between the browser and the server
ViewState
allows the developer to interact with information at various points in the HTML creation phase
ASP.NET lifecycle
What are the seven (7) lifecycle stages?
- Page Request
- Start
- Initialization
- Load
- Postback Event Handling
- Rendering
- Unload
This state 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.
Page Request
The page starts to do some processing on the HTTP Request. Some base variables are initialized, such as Request, Response, and the UICulture
Start
During this phase, the controls on the page are initialized and assigned their unique IDs. Master pages and themes are applied as applicable
Initialization
If the request is a postback, control information is loaded with the information recovered from the view state
Load
If the request is a postback, all the various controls fire their event handlers as needed. Validation also happens at this time.
Postback Event Handling
Before the rendering state starts, ViewState is saved for the page and all of the controls as configured.
Rendering
This happens after the content is created and sent to the client. Objects are unloaded from memory and cleanup happens.
Unload
Raised after the start state is complete and before the initialization state begins
PreInit
This event is raised after all the controls have been initialized. It is used to initialize control properties
Init
Only one thing happens between Init and InitComplete, and that is the enabling of view state for the controls.
Changes in this event and after will impact viewstate to make sure it will be available next postback.
InitComplete
Raised after the page manages the view state information for itself and all controls
PreLoad
The OnLoad method is called in a page, which then recursively calls the same method on every control
Load
These are specific control-based events, such as the Click of a button, or TextChanged on a text box.
Control Events
This event is raised after all the event handling has occured
LoadComplete
After all the controls have been loaded, the Page object starts its prerender phase
PreRender
Raised after every data-bound control has been bound
PreRenderComplete
Raised after the view state and control state have been saved for the page and for all controls
SaveStateComplete
This is not an event. Rather at this point in the process, the Page object calls this method on each control
Render
This is used to perform special cleanup activities, such as closing files or database connections, logging, etc.
Unload
are the items that a developer places on an ASP .NET web page
ASP .NET server controls
What are the four main types of controls?
- HTML server controls
- Web server controls
- Validation controls
- User controls
wrappers for traditional HTML elements
HTML server controls
tends to encompass more functionality and be more abstract than an HTML server control
Web server controls
ensures that the values entered into other controls meet certain criteria, or are valid.
Validation 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
User controls