| Author: Meetu Choudhary 16 Oct 2008 | Member Level: Gold | Rating: Points: 2 |
the prerender event is executed before the rendering of the particular object so if you want to set the details before the object is displayed or rendered to the user we use this event
hope it is clear to you now.
== Thanks and regards Meetu Choudhary
|
| Author: gomathinayagam 16 Oct 2008 | Member Level: Gold | Rating: Points: 2 |
After PostBack event, page prepares for rendering. PreRender event is called. This is the place where user can do the update operations before the viewstate is stored and output is rendered. Next stage is saving view state, all the values of the controls will be saved to their own viewstate collection. The resultant viewstate is serialized, hashed, base24 encoded and associated with the _viewstate hidden field.
|
| Author: Nagarajan 16 Oct 2008 | Member Level: Gold | Rating: Points: -20 |
OnPreRender is indeed an event raised as part of the page life-cycle. The page's OnPreRender method may be overridden or a delegate may be used to define an Event Handler in a manner similar to Page_Load and Page_Init.
protected override void OnPreRender(System.EventArgs e) { // PreRender code base.OnPreRender(); }
or this.PreRender += new System.EventHandler(Page_PreRender);
OnPreRender is typically used for handling some last minute tasks such as enabling or disabling controls or modifying other content after control events have been handled but before the viewstate is saved and the HTML is rendered [generated].
In another way "The PreRender event is raised just before the page is about to render its contents. This is the last chance to modify a page output before it is sent to the browser".
Hope this helps Happy Coder.
|