Life Cycle Events
PreInit
The properties like IsPostBack have been set at this time.
This event will be used when we want to:
Some controls like:
PreInit
The properties like IsPostBack have been set at this time.
This event will be used when we want to:
- Set master page dynamically.
- Set theme dynamically.
- Read or set profile property values.
- This event is also preferred if want to create any dynamic controls.
- Raised after all the controls have been initialized with their default values and any skin settings have been applied.
- Fired for individual controls first and then for page.
- Fires only if IsPostBack is true.
- Values stored in HiddenField with id as _ViewState decoded and stored into corresponding controls.
Some controls like:
- Fires only if IsPostBack is true.
- Some controls like Textbox are implemented from IPostBackDataHandler and this fires only for such controls.
- In this event page processes postback data included in the request object pass it to the respective controls.
- Used only if want to inject logic before actual page load starts.
- Used normally to perform tasks which are common to all requests, such as setting up a database query.
- This event is fired when IsPostBack is true.
- Use these events to handle specific control events, such as a Button control's Click event or a TextBox control's TextChanged event.
- Use the event to make final changes to the contents of the page or its controls before the values are stored into the viewstate and the rendering stage begins.
- Mainly used when we want to inject custom JavaScript logic.
- All the control values that support viewstate are encoded and stored into the viewstate.
- We can add custom HTML to the output if we want here.
- Fired for individual controls first and then for page.
0 comments:
Post a Comment