Mr said:
Thats interesting, Ive never come across this before , why is that
Hans ?
Regards Mr N
AutoEventWireup=true (default!) will automatically hook Page_Load to the
Load event of the Page. When you also add it "by hand" (could be
done automatically for a C# codebehind) with a this.Load += ...,
then it is added a second time (and executed a second time).
from MSDN:
----
Alternatively, the ASP.NET page framework also supports an automatic way to associate page events and methods. If the
AutoEventWireup attribute of the Page directive is set to true (or if it is missing, since by default it is true), the page
framework calls page events automatically, specifically the Page_Init and Page_Load methods. In that case, no explicit Handles
clause or delegate is needed.
The disadvantage of the AutoEventWireup attribute is that it requires that the page event handlers have specific, predictable names.
This limits your flexibility in how you name your event handlers. Therefore, in Visual Studio, the AutoEventWireup attribute is set
to false by default and the designer generates explicit code to bind page events to methods.
If you do set AutoEventWireup to true, Visual Studio will generate code to bind the events and the page framework will automatically
call events based on their names. This can result in the same event code being called twice when the page runs. As a consequence,
you should always leave AutoEventWireup set to false when working in Visual Studio.