Posted: 7/6/2010
Hello Experts,
There is a below event in ASP.NET page life cycle.
protected override void OnPreRenderComplete(EventArgs e) { }
Can anyone explain me what this event do?
Thanks in advance.
Posted: 7/7/2010
Hi,
As the documentation states:
"It Raises the PreRenderComplete event after the OnPreRenderComplete event and before the page is rendered.The OnPreRenderComplete method is called when the prerendering stage of the page life cycle is complete. At this stage of the page life cycle, all controls are created and the page is ready to render the output. This is the last event called before the page's view state is saved."
Reference: http://msdn.microsoft.com/en-us/library/system.web.ui.page.onprerendercomplete.aspx
Vinz's post answers everything!
Moreover, I will add that you can even understand it by reading the name of the event OnPreRenderComplete - means, happens right before rendering the output of the web page.
"So, the controls are created waiting rendering the output :)."
You should be aware that there are many times when an Event lasts in a single moment - but thanks God, events have very descriptive names that explains half of the story :).
Posted: 7/8/2010
Thank you Vinz and Hajan:)
Posted: 7/9/2010
You are welcome, as always ;)