G
Guest
Hi, this is a follow-up to an earlier question but I really haven't found a
definitive answer in my search
If I have a Base and Derived webform, I've found that the dervived Page_Load
event fires first, then the base Page_Load.
Is the only technique to change this sequence is to override the
Base.Page_Load and explicitely call the base event when you want to as below:
Derived WebForm
--------------------
override private void Page_Load(object sender, System.EventArgs e)
{
base.Page_Load(sender, e); //Run it first
'--Then the rest of dervived code goes here...
}
To me, if you were building a framework and had some generic code in the
base class, that should run first before the derived more specific code.
In the case above, if you wanted the base code to run first, all your
developers would then have to explicitly remember to override and call
base.Page_Load.
If this is the default behavior of asp.net that fine, I just wanted to find
a definate answer.
Thanks, Dave.
definitive answer in my search
If I have a Base and Derived webform, I've found that the dervived Page_Load
event fires first, then the base Page_Load.
Is the only technique to change this sequence is to override the
Base.Page_Load and explicitely call the base event when you want to as below:
Derived WebForm
--------------------
override private void Page_Load(object sender, System.EventArgs e)
{
base.Page_Load(sender, e); //Run it first
'--Then the rest of dervived code goes here...
}
To me, if you were building a framework and had some generic code in the
base class, that should run first before the derived more specific code.
In the case above, if you wanted the base code to run first, all your
developers would then have to explicitly remember to override and call
base.Page_Load.
If this is the default behavior of asp.net that fine, I just wanted to find
a definate answer.
Thanks, Dave.