In VB.NET ASP.NET you have something called AutoEventWireUp. It is set in the directives of the webform's HTML
<%@ Page Language="vb" AutoEventWireup="true" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1"%>
When set to true asp.net will automatacally "wire up" methods of the page's class with events in the lifecycle of the page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
ListBox1.Items.Add("From Load")
End Sub
An alternative is to explicitly states in you method declaration that it will handel a certain event
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.Items.Add("From Load")
End Sub
Now guess what happens when both AutoEventWireUp is set to true and Handles is specified ? Exactly, the method will execute twice.
Anders Hejlsberg, the creator of my beloved C#, always makes a strong point of not adding a new feature to the C# language when it will open the possibility to do the same thing on two different ways. Because that could be confusing. This VB wireup feauture is more than confusing, to me it's just a mess. Two very different ways to get the same thing done, one in a directive and one in "normal"code. And both ways hide the fact that you are not assigning one specific method as a handler for an event. In .net multiple methods can subscribe to an event, the C# version of the generated InitializeComponenet demonstrates this. The same method can even subscribe twice to the same event. Like just demonstrated.
Peter