Skip to main content

ASP.NET Web Page and Server Controls Events


Method(Event)
Description
OnInit (init)
Initializes child controls of the current control.
LoadControlState
Used to load control state. Register this event in OnInit e.g: Page.RegisterRequiresControlState
LoadViewState
Loads View state of the control.
LoadPostData
Is defined in IPostBackDataHandler. Used to retrieve post data to update control’s properties.
Load (OnLoad)
Controls is created & is in stable state. Place code that is common to all requests.
RaisePostDataChangedEvent
Is defined in IPostBackDataHandler. Is called when Posted data is changed from previous posted data. E.g: TextBox, TextChanged Event binded, AutoPostback=False, If a button is clicked this event will then raise before Click Event handler.
RaisePostBackEvent
Button click etc that caused the post back.
PreRender(OnPreRender)
Any changes made here will be apparent in render and will be saved.
SaveControlState
Requires Page.RegisterRequiresControlState.
SaveViewState
Saves View State
Render
Render HTML and DHTML contents.
Dispose
Release Unmanaged resources.
UnLoad
Release managed resources.