<%@ Page Language="VB" %>
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
Dim strTimePageLoaded As String
strTimePageLoaded = Request.QueryString("time")
If IsDate(strTimePageLoaded) Then
lblTimeSpent.Text = "You spent " _
& DateDiff("s", CDate(strTimePageLoaded), Now()) _
& " seconds looking at the previous page."
Else
lblTimeSpent.Text = "You haven't clicked on the link below yet."
End If
End Sub
</script>
<html>
<head>
<title>ASP.NET Time Spent on Page Sample</title>
</head>
<body>
<p>
<asp:Label id="lblTimeSpent" runat="server" />
</p>