ASP.Net/Page/Page Unload — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 11:53, 26 мая 2010

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>