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.
XIII
All-Star
182787 Points
23484 Posts
ASPInsiders
Moderator
MVP
Re: What is AutoEventWireup?
Oct 28, 2005 06:31 PM|LINK
this is taken from the MSDN library:
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.
Resource: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebFormsEventModel.asp
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!