Click to See Complete Forum and Search --> : Timer in Asp.net page


inbaraj
03-30-2006, 12:45 AM
Hi,

In my project i want to use timer control(Asp.net using C#). I tryed the timer control which is in the tool box it is not working in the web page.

My project is about viewing the movie in the online the use will be given a password, with that password the use will be entering the page when he enter the page the timer should start after time is expire the running movie should be stoped and the login page should be displayed.

Please i need help in this...........

Thanks

inba........... :)

handshakeit
03-30-2006, 05:19 AM
HI

I have given this example script in ohter thread also

<%@ 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>

<p>
<a href="time.aspx?time=<%= Server.URLEncode(Now())%>">How long have I spent on this page?</a>
</p>

<hr />

<p>
Click <a href="http://www.asp101.com/samples/time_aspx.asp">here</a> to read about and download the source code.
</p>

</body>
</html>