override OnLoad or handle Load event
-
Hi all, Curious why by default Visual Studio makes you handle the Load event, when you derive a class. Usually in a derived class I would think you would: protected override void OnLoad( EventArgs e ) { // my code base.OnLoad(e); // this will raise the Load event. // my code, is this the better spot, let the base do its load first? } but it seems that Visual Studio always adds an event handler to the Load event in your class for you to implement your own OnLoad code, why? OnInit(){ Load += new EventHandler( Page_Load ); } With windows forms, the documentation says that overriding OnFoo is the preferred way for inheritors. So why not for asp.net web controls, why the event handler instead? Is there much difference? Thanks for your opinions/help.