<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(Sender as Object, e as EventArgs)
if not Page.IsPostBack then
ViewState("StartTime") = DateTime.Now
lblMessage.Text = "The time is now: " & _
ViewState("StartTime")
end if
end sub
Sub Submit(obj as object, e as EventArgs)
lblMessage.Text = "The time is now: " & DateTime.Now & _
"<br>started at: " & ViewState("StartTime")
end Sub
</script>
<html><body>
<form runat="server">
<asp:Button id="btSubmit" runat="server" Text="Submit"
onClick="Submit" />
<asp:Label id="lblMessage" runat=server />
</form>
</body></html>
|