Name
Load
Synopsis
Sub Page_Load(Sender As Object, e As EventArgs) ‘code End Sub
Fired when the page is loaded. Since this event is fired on every page request, we can add any initialization code that needs to be executed at the page level, including the initialization of the page’s child controls. When the Load event fires, the page’s view state information is also accessible.
The Load event is passed the following arguments by ASP.NET:
-
Sender An argument containing information about the object that raised the event.
-
e An object of type EventArgs containing additional information about the event.
Example
See the example for Init.
Notes
Note that the Sender and
e arguments are optional for this event,
as shown in the example.
When the AutoEventWireup attribute of the
@ Page directive is set to True
(the default), ASP.NET will automatically call the event handler for
this event, as long as it has the correct Page_Load event signature.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access