In Windows forms, you can place code in the Form_Load event to initialize the form when it first loads; in Web forms, you use the Page_Load event instead:
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
For an example, see "Writing HTML to a Web Form at Run Time" later in this chapter.