Click here to Skip to main content
15,799,019 members
Please Sign up or sign in to vote.
1.18/5 (3 votes)
See more:
how to use timer in

Updated 11-Jun-18 0:48am

OK, With reference to this question this is the best source code to be referred, Download it and see how timer works in Online Exams...

Online Exam in C# ASP NET[^]

All The Best:-)
Share this answer
Hi ,
This Example will Guide you .
     <asp:ScriptManager ID="ScriptManager1" runat="server">
     <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="2000">
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
               <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

                   <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />


protected void Page_Load(object sender, EventArgs e)

protected void Timer1_Tick(object sender, EventArgs e)
    Label1.Text = DateTime.Now.ToString();

Best Regards
Share this answer
Pugal Kannan 2-Jun-14 1:06am    
Above code is working well in local system., but after hosting my website its not working in server
Member 11818688 9-Feb-17 7:28am    
how can stop this timer??????
<asp:timer id="t1" runat="server" ontick="Timer1_Tick" interval="1000" xmlns:asp="#unknown">

protected Timer1_Tick()
int i=0;
Share this answer
kashifjaat 28-Sep-14 23:39pm    
How Set unique timer of every client on page_Load , when page load timer will be start zero, but in my case its not happing , lets if one person is currently use page and i open same page then timer shows the value of that person or page count down??? How I resolve this issu???
hi, by adding timer in the page it scrolls the page automatically even if updatepanel is used. so, to overcome this issue I am using following code in page definition

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