Control.Load 事件

定義

發生於載入伺服器控制項至 Page 物件時。

public:
 event EventHandler ^ Load;
public event EventHandler Load;
member this.Load : EventHandler 
Public Custom Event Load As EventHandler 

事件類型

範例

// This is the constructor for a custom Page class. 
// When this constructor is called, it associates the Control.Load event,
// which the Page class inherits from the Control class, with the Page_Load
// event handler for this version of the page.
public MyPage()
{
   Load += new EventHandler(Page_Load);
}
' This is the constructor for a custom Page class. 
' When this constructor is called, it associates the Control.Load event,
' which the Page class inherits from the Control class, with the Page_Load
' event handler for this version of the page.
Public Sub New()
   AddHandler Load, AddressOf Page_Load
End Sub

備註

通知伺服器控制項執行設定為在每個頁面要求上發生的任何處理步驟。 您可以從此事件存取檢視狀態資訊和 Web 表單 POST 資料。 您也可以存取頁面控制項階層中的其他伺服器控制項。

注意

如果您在事件期間 Page_Load 于 控制項中設定自訂範本,則自訂範本中的子控制項文字值將會遺失。 這是因為已經載入表單值。

適用於

另請參閱