When I override an event from a parent class, for example the OnLoad() method in System.Web.UI.Page, why is “base.OnLoad(e)” still called, but even when I remove the call to the overridden method in the base class, the Load event is still fired?
public partial class _Default : System.Web.UI.Page
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
}
The call to base.OnLoad(e) ensures that everything in the base implementation of the method gets called in addition to your code overriding that method (rather than only the code in your overriden method being executed).
In either case, it should have no bearing on the event being successfully fired or not.