Control.Load Zdarzenie

Definicja

Występuje, gdy kontrolka serwera jest ładowana do Page obiektu.

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

Typ zdarzenia

Przykłady

// 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

Uwagi

Powiadamia kontrolkę serwera o wykonaniu wszelkich kroków przetwarzania, które mają być wykonywane w każdym żądaniu strony. Dostęp do informacji o stanie i danych POST formularza internetowego można uzyskać z tego zdarzenia. Dostęp do innych kontrolek serwera można również uzyskać w hierarchii kontroli strony.

Uwaga

Jeśli ustawisz szablon niestandardowy w kontrolce podczas Page_Load zdarzenia, wartości tekstowe kontrolek podrzędnych w szablonie niestandardowym zostaną utracone. Dzieje się tak, ponieważ wartości formularza zostały już załadowane.

Dotyczy

Zobacz też