Mega Code Archive

 
Categories / ASP.Net / Page
 

Page init and load event (VB net)

<script language="vb" runat="server"> Dim intGlobal As Integer = 0 Sub Page_Init()   intGlobal=intGlobal+1   Message1.Text += "<br>Page_Init has called this line at " & Now() & _                             " with the value of intGlobal being :" & intGlobal End Sub Sub Page_Load()   intGlobal=intGlobal+1   Message2.Text += "<br>Page_Load has called this line at " & Now() & _                              " with the value of intGlobal being :" & intGlobal End Sub </script> <html> <head>   <title>Automatic Events Example</title> </head> <body> <form runat="server">   <input type="submit" value="Click to continue">   <br />    <asp:label id="message1" runat="server"/>   <asp:label id="message2" runat="server"/> </form> </body> </html>