Few lines about PreRender event

Welcome to CodeSpread!

Background

To know PreRender and understand its  importance, we should know the events before it and after it. We start with,

Page object including all controls are loaded and the page is ready to be rendered to the output. Here, as a last event before PreRender, Handle Postback event is fired.

Handle PostBack Event: This event is caused by the postback trigger of any controls from client side.

downarrow

Prerender:  For this event, all controls are available and it is the last stage where we have access to the controls so any operation before the server control is rendered can be performed here. Any changes in the view state of the server control can be saved during this event.

downarrow

Save ViewState:  ViewState is a property of a control and for all the controls, their viewstate will be saved to their own viewstate collection. The resultant viewstate is serialized, hashed, base24 encoded and is sent to the client as a hidden variable, _viewstate.
downarrow

Page is rendered to the client in HTML form.

Conclusion: PreRender event is used to make final changes to the contents of the page or its controls before the rendering stage begins.

Note: Databinding is raised after the control’s PreRender event, This event marks the beginning of the process that binds the control to the data.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  1. thanks for the tutorial
    I am having a problem.
    The feature “Create SQL server database” isn’t available , I can’t select it.
    Can you help, please ?