I have a content page overriding the OnInit event of the main page. Overriding works fine until I place the user control on the page: in this case, the OnInit event does not fire on the content page (overrides are not used in the user element)
What are the possible reasons / solutions for this? (I use the OnInit event to create dynamic controls)
Edit:
now I tried this on the content page:
(The OnPreInit part is executed, but Masters_Init is not called ...)
protected override void OnPreInit(EventArgs e)
{
base.Master.Init += new EventHandler(Masters_Init);
}
void Masters_Init(object sender, EventArgs e)
{
}
source
share