Page_OnInit event

D

Daves

I am using 2.0 Masterpages. I want to add some text after the content page
code has been run and so thought I could add an OnInit event in the
masterpage class:

void Page_OnInit(System.EventArgs e)
{ .... }


for some reason this code is never run... Am I doing something wrong?
Running the debugger with a breakpoint it never halts there so it's
definitely not being run...
 
G

Guest

Hi,

in OnInit event server controls would perform any initialization steps that
are required to create and set up an instance. In this stage of the server
control's lifecycle, the control's view state has yet to be populated.
Additionally, you can not access server controls when this method is called
either, regardless of whether it is a child or parent control. Other server
controls are not certain to be created and ready for access.

Cheers,

Jerome. M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,121
Latest member
LowellMcGu
Top