AutoEventWireup=“false”Page_Load怎么执行??
如果将 AutoEventWireup设为true,Page_Load会执行两次。
如果将 AutoEventWireup设为false,Page_Load不会执行。
那么如何让Page_Load执行一次呢。
看网上的说是要加入代码:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.Load += new System.EventHandler(this.Page_Load);
}
问题是,加入以上代码后,Page_Load还是会执行两次。
如何让Page_Load执行一次??