ASP.Net/Page/Page Unload — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 14:53, 26 мая 2010
Using the UnLoad Event of the Page Object
<source lang="csharp">
<%@ 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"
/>
<asp:label
id="lblStatic" runat="server"
/>
<asp:label
id="lblDone" runat="server"
/> </Form> </BODY> </HTML>
</source>