What are Form methods that control its lifecycle? - DOT.NET

What are Form methods that control its lifecycle?

What is a Form?

- It is a part of the .NET web application framework.

- It is the container for all the controls that make up the user interface.

- First a form object is created using the constructor. The form is then loaded and then its layout is initialized. After that it gets activated after which the paint is called.

- The reverse procedure is followed to remove it. First comes closing, then the form gets deactivated and then the dispose is called for the deallocation.

The following table provides a high-level overview of the phases in the lifecycle of a control.

PhasesOperationsMethods
InitializeInitialize settings needed during the lifetime of the incoming Web request.Init event (OnInitmethod)
Load view stateAt the end of this phase, the ViewState property of a control is automatically populated as described in Maintaining State in a Control. A control can override the default implementation of the LoadViewState method to customize state restoration.LoadViewState method
Process postback dataProcess incoming form data and update properties accordingly.LoadPostData method
(ifIPostBackDataHandler is implemented)
LoadPerform actions common to all requests, such as setting up a database query. At this point, server controls in the tree are created and initialized, the state is restored, and form controls reflect client-side data. Load event
(OnLoadmethod)
Send postback change notificationsRaise change events in response to state changes between the current and previous postbacks. SeeProcessing Postback Data.RaisePostDataChangedEvent method
(ifIPostBackDataHandler is implemented)
Handle postback eventsHandle the client-side event that caused the postback and raise appropriate events on the server. RaisePostBackEvent method
(ifIPostBackEventHandler is implemented)
PrerenderPerform any updates before the output is rendered. Any changes made to the state of the control in the prerender phase can be saved, while changes made in the rendering phase are lost.PreRenderevent
(OnPreRender method)
Save stateThe ViewState property of a control is automatically persisted to a string object after this stage. This string object is sent to the client and back as a hidden variable. For improving efficiency, a control can override the SaveViewState method to modify the ViewState property.SaveViewState method
RenderGenerate output to be rendered to the client. Render method
DisposePerform any final cleanup before the control is torn down. References to expensive resources such as database connections must be released in this phase. Dispose method
UnloadPerform any final cleanup before the control is torn down. Control authors generally perform cleanup in Dispose and do not handle this event.UnLoad event (On UnLoadmethod)
What is manifest? - DOT.NET
An Assembly data like version, scope, security information (strong name),etc is stored in manifest.....
What is the use of SN.EXE? - DOT.NET
SN stands for Strong Name. Strong Name Tool (Sn.exe) is used to sign assemblies with strong names......
Explain the different types of assemblies in .NET - DOT.NET
Static assemblies contain interfaces, classes, resources, etc for the assembly and are stored on disk in portable executable (PE) files.....
Post your comment