A
Andy Breward
Hi
I have created a base web form that all other pages
inherit from which is really nice as all my session and
seurity stuff goes in here and works well.
My issue is with the source code that the IDE creates,
this function: -
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web
Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
Should the call to OnInit on the base form go before the
InitializeComponent() method? My reasoning is that
otherwise none of the base pages variables etc. have been
set during the Page_Load event of my real form until
afterwards!
I have simply been swapping these 2 lines around to gain
the desired result. So am I missing something in my
implementation or are my observations correct?
Thanks in advance
Andy
I have created a base web form that all other pages
inherit from which is really nice as all my session and
seurity stuff goes in here and works well.
My issue is with the source code that the IDE creates,
this function: -
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web
Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
Should the call to OnInit on the base form go before the
InitializeComponent() method? My reasoning is that
otherwise none of the base pages variables etc. have been
set during the Page_Load event of my real form until
afterwards!
I have simply been swapping these 2 lines around to gain
the desired result. So am I missing something in my
implementation or are my observations correct?
Thanks in advance
Andy