AutoEventWireup attribute in ASP.NET

Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"

The ASP.NET page framework supports an automatic way to associate page events and methods. If the AutoEventWireup attribute of the Page directive is set to 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.

*
AutoEventWireup is an attribute in Page directive.
*
AutoEventWireup is a Boolean attribute that indicates whether the ASP.NET pages events are auto-wired.
*
AutoEventWireup will have a value true or false. By default it is true.

There is no event or method associated with Page_Load. Those events whose inline event is not there but that should be executed, for that purposed AutoEventWireup="true".



If AutoEventWireup="false" but still you want to executed Page event (Page_Load). In this you have to explicitly code for it.

form id="form1" runat="server" onload="Page_Load"

No comments:

Post a Comment