I was working on adding dynamic controls to asp page.
In the sample code, the control counter was increased in preinit and
controls were initialized in oninit.
What is the difference between preinit phaze and oninit phaze?
Can I increase the counter and then initialize the controls at the very beginning
in Page_Load?
yes you can.
PreInit:Raised after the start stage is complete and before the initialization stage begins.
Init:Raised after all controls have been initialized and any skin settings have been applied. The Init event of individual controls occurs before the Init event of the page.Use this event to read or initialize control properties.
an explanation over the asp.net page life cycles is here.