Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to use timer control in asp.net website
when page loads timer should start and should get inactive or pop msg saying your time over on scheduled time
using C#
Posted
Updated 24-Jul-13 2:37am
v2
Comments
bbirajdar 24-Jul-13 8:36am    
Tried to google ?
Jean A Brandelero 24-Jul-13 8:44am    
Timer just work on server side... If you want to show a message in the client side, you will need javascript.
Use:
setTimeout('ximba()', 500);

Refer the links below:
Introduction to the Timer Control[^]
How to use Timer in asp.net ajax[^]
Walkthrough: Using the ASP.NET Timer Control[^]

A video article here[^].

......And many more here[^]


--Amit
 
Share this answer
 
XML
<%@ 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>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900