wyrd
Well-known member
Okay.. with events in ASP.NET, for the code behind, the VS for some odd reason makes all of the functions for the events private. Because of this, in the main aspx page you cant use OnClick because the functions are private.
Can someone please explain to me the logic in why VS does this? Because it does this it has to add a ton of code (well, not for VB, but for C# it does) for adding events;
this.Button2.Click += new System.EventHandler(this.Button2_Click);
Sure it may not be to big of a deal when using the IDE, because it adds all this code for you when you double click something. But generally when you code by hand, why on earth would you want to do allllll that typing?
Is there a specific reason why it makes the functions private rather then just protected? Is there some benefit in this that Im not seeing?
Can someone please explain to me the logic in why VS does this? Because it does this it has to add a ton of code (well, not for VB, but for C# it does) for adding events;
this.Button2.Click += new System.EventHandler(this.Button2_Click);
Sure it may not be to big of a deal when using the IDE, because it adds all this code for you when you double click something. But generally when you code by hand, why on earth would you want to do allllll that typing?
Is there a specific reason why it makes the functions private rather then just protected? Is there some benefit in this that Im not seeing?