Using the UnLoad Event of the Page Object
<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
lblFixed.Text = "Welcome to the page!"
lblStatic.Text = "The current time on the server is " _
& TimeOfDay()
lblDone.Text = Session("FinalText")
End Sub
Sub Page_Unload(ByVal Sender as Object, ByVal E as EventArgs)
Session("FinalText") = "During last load, the " _
& "page finished processing at: " & TimeOfDay()
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the UnLoad Event of the Page Object</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
id="lblFixed"
runat="server"
/>
<BR><BR>
<asp:label
id="lblStatic"
runat="server"
/>
<BR><BR>
<asp:label
id="lblDone"
runat="server"
/>
</Form>
</BODY>
</HTML>
Related examples in the same category