This parameter is not intended to trigger an event, but to bind handlers to standard page events. Compare these two snippets that illustrate the handling of the Load event.
First with AutoEventWireup="true" :
public class PageWithAutoEventWireup { protected void Page_Load(object sender, EventArgs e) { Response.Write("Page_Load is called"); } }
Secondly, with AutoEventWireup="false" :
public class PageWithoutAutoEventWireup { override void OnInit(EventArgs e) { this.Load += Page_Load; } protected void Page_Load(object sender, EventArgs e) { Response.Write("Page_Load is called"); } }
The Load event will be triggered by the page and processed by your code in both cases. But in the second case, you must subscribe to the event explicitly, while in the first case, ASP.NET will do everything for you.
Of course, the same goes for other page life cycle events such as Init , PreRender , etc.
source share