what is the difference between page load and page prerender event?
for ex: i have one checkbox control.
based on the value(yes or no) returning from the database i want to check the checkbox.
in this situation, which event is suitable?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SreekarPosted Aug 14, 2006, 3:30 AM
Both are page events that fire on every page load. Only the order in which they fire varies. You need to cash on this order.Page load would fire after page initialization process and prerender as name suggests will fire just before rendering html process (for client). Most of the time we handle page process in pageload event along with specific control events like button_click. But there may be certain situations where you want to hold some process or setting properties or whatever or in your case checkbox cheked/unchecked at the very last after all other events are fired. PageRender is one such event where you can make your final decisions.
Sathya RameshPosted Aug 7, 2006, 8:17 AM
PreRender-the brief moment of the page.
The page lifecycle goes likes this
1)Init
2)Load
3)Prerender
4)Unload
Suppose for example, you want to display the item selected in the checkbox in a label you can use page Prerender. Because everytime the page refreshes it will be updated in the label provided.but in page load this does not happen.
For other things like binding data to a gridview you can use page Load.
I think for the question you have asked page load is better.