Click here to Skip to main content
11,703,617 members (63,046 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
how to use timer in asp.net?

		
Posted 3-Apr-12 19:12pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 BestSmile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi ,
This Example will Guide you .
<div>
     <asp:ScriptManager ID="ScriptManager1" runat="server">
     </asp:ScriptManager>
     <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="2000">
     </asp:Timer>
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
           <ContentTemplate>
               <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
           </ContentTemplate>
               <Triggers>
 
                   <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
 
               </Triggers>
     </asp:UpdatePanel>
 </div>

protected void Page_Load(object sender, EventArgs e)
{
 
}
protected void Timer1_Tick(object sender, EventArgs e)
{
    Label1.Text = DateTime.Now.ToString();
}
Best Regards
M.Mitwalli
  Permalink  
Comments
Pugal Kannan at 2-Jun-14 1:06am
   
Above code is working well in local system., but after hosting my website its not working in server
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
venkat vangal at 17-Oct-12 4:33am
   
Hi The below link had c# and java script coding for Timer implementation

http://vangalvenkat.blogspot.in/2012/10/aspnet-online-test-with-timer.html
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

The Below post will clearly explains with c# and java script coding

http://vangalvenkat.blogspot.in/2012/10/aspnet-online-test-with-timer.html
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

<asp:timer id="t1" runat="server" ontick="Timer1_Tick" interval="1000" xmlns:asp="#unknown">


protected Timer1_Tick()
{
int i=0;
t1.Enabled=true;
Button1.Width=Button1.Width-20;
if(i==35)
{
t1.Enabled=false;
}
}
  Permalink  
Comments
kashifjaat at 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???
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

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

MaintainScrollPositionOnPostback="true"
  Permalink  

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

  Print Answers RSS
0 Maciej Los 570
1 OriginalGriff 515
2 Sergey Alexandrovich Kryukov 460
3 Andy Lanng 209
4 CPallini 195
0 OriginalGriff 8,519
1 Sergey Alexandrovich Kryukov 7,667
2 CPallini 4,987
3 Maciej Los 4,686
4 Mika Wendelius 3,566


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 22 Nov 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100