V
Vin
Hi,
I have some odd behavior in my PreInit.
A control on my page is null at the time of PreInit so I can't give it
the values it needs for it's Init, it is valid by the time of the Init
on the page but that is too late.
So here is the detailed description:
I have a Web Application with a page, Page1.
Page1 has a custom control, MyWizard, added to it which I use to wrap
the standard wizard control.
MyWizard is added statically to Page1.aspx (appears in
Page1.aspx.designer.cs)
I was using MyWizard:age_Load to dynamically create Controls and add
them to dynamically created WizardSteps.
I hit some problems recently and after reading a bit discovered that
dynamic controls should be added using the Page_Init event.
So I added a Page_PreInit handler to Page1 to set the controls data.
When I try and access MyWizard in Page_PreInit it is null!
I have tried this is a simple test project and the controls are valid
in PreInit so this seems to be non-standard behavior.
I am stuck, I can't use PreInit to initialise my Control but I have to
use it or the dynamic controls don't behave properly.
Has anyone encountered this?
Or have any suggestions on how to track it down further?
Thanks, Vin
I have some odd behavior in my PreInit.
A control on my page is null at the time of PreInit so I can't give it
the values it needs for it's Init, it is valid by the time of the Init
on the page but that is too late.
So here is the detailed description:
I have a Web Application with a page, Page1.
Page1 has a custom control, MyWizard, added to it which I use to wrap
the standard wizard control.
MyWizard is added statically to Page1.aspx (appears in
Page1.aspx.designer.cs)
I was using MyWizard:age_Load to dynamically create Controls and add
them to dynamically created WizardSteps.
I hit some problems recently and after reading a bit discovered that
dynamic controls should be added using the Page_Init event.
So I added a Page_PreInit handler to Page1 to set the controls data.
When I try and access MyWizard in Page_PreInit it is null!
I have tried this is a simple test project and the controls are valid
in PreInit so this seems to be non-standard behavior.
I am stuck, I can't use PreInit to initialise my Control but I have to
use it or the dynamic controls don't behave properly.
Has anyone encountered this?
Or have any suggestions on how to track it down further?
Thanks, Vin