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

備註

通知伺服器控制執行每個頁面請求設定的處理步驟。 您可以存取本次活動的州資訊及網頁表單POST資料。 你也可以存取頁面控制階層中其他伺服器控制項。

Note

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

適用於

另請參閱