I might have misunderstood the meaning of base.OnLoad(e);
My understanding was that this statement will call the OnLoad method of the base class of the class where it's called from. However, when I use the debugger to step through the code, I see different results.
public abstract class BaseUC : System.Web.UI.UserControl
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
SomeAbstractMethod();
}
}
In the ascx.cs concrete class
public partial class MyUserControl : BaseUC
{
protected void Page_Load(object sender, EventArgs e)
{
//On Load logic
}
}
I have a breakpoint on base.OnLoad(e)
. When I press F11 (step into), the debugger takes me to Page_Load
of MyUserControl, so the flow of control is:
BaseUC.OnLoad()
MyUserControl.Page_Load()
BaseUC.SomeAbstractMethod()
Can someone explain what's going on here?