What is Pre-Render event in ASP.NET?
Mahesh Chand
Use this event to perform any updates before the server control is rendered to the page. Any changes in the view state of the server control can be saved during this event. Such changes made in the rendering phase will not be saved.
How to generate this event?..mean like double click on page then "page_load" event will generate then how about "Page_PreRender" event?
In this event All the values of controls saves to Viewstate. After this event modification in page is not possible We can do final changes in this event before rendering this page
Page_Load happens often too soon; Page_PreRender is the last moment before the page's HTML is actually rendered for the browser and in many cases is the best place to set attributes on user controls.This because during the web form (page) life cycle there are other events in the page (and in the user controls contained in the page...) which sometimes remove/replace/overwrite (really) those attributes so the only way you can get those attributes to the browser is to append them after all other life cycle events have been fired and handled, in the Page_PreRender.
PreRender is the event that takes place before the HTML for a given page is generated and sent to the browser