I have several UpdatePanels and a timer in each of them, as every panel has to be updated at different intervals. However, using the ASP.NET AJAX timer, only one is triggered and it seems to reset the other timers on the postback and thus the others never
trigger. I was testing the Telerik Timer control and all of them were ticking properly, however it looks like they caused a memory leak in the WebDevServer as when using them, memory consumption always quickly shot up to over 1 GB.
Does anyone know of a fix or workaround how to get all timers ticking properly?
as discussed in http://forums.asp.net/thread/1648410.aspx, the Ajax timers get reset on postback (even if they are in different update panels). I think they have only begun delving into the potential
of these controls. I do not know that there is anything you can do about this behavior at this time.
Please click 'Mark as Answer' if reply assisted you.
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." ~ Douglas Adams
Here is a solution I was able to use. Perhaps this will help someone visualize it. I have two timers counting off; 1 counts seconds, the other counts 60 seconds. each triggers an update panel which adds a number to a labels current integer value and re-enabled
the calling trigger.
Please click 'Mark as Answer' if reply assisted you.
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." ~ Douglas Adams
Marked as answer by bbcompent1 on Aug 08, 2012 12:02 PM
Here is a solution I was able to use. Perhaps this will help someone visualize it. I have two timers counting off; 1 counts seconds, the other counts 60 seconds. each triggers an update panel which adds a number to a labels current integer value and re-enabled
the calling trigger.
Daikoku
Member
13 Points
33 Posts
Multiple Timers - Only on is ticking
Apr 27, 2007 03:06 PM|LINK
Hi,
I have several UpdatePanels and a timer in each of them, as every panel has to be updated at different intervals. However, using the ASP.NET AJAX timer, only one is triggered and it seems to reset the other timers on the postback and thus the others never trigger. I was testing the Telerik Timer control and all of them were ticking properly, however it looks like they caused a memory leak in the WebDevServer as when using them, memory consumption always quickly shot up to over 1 GB.
Does anyone know of a fix or workaround how to get all timers ticking properly?
Thanks
pixelsyndica...
Star
7826 Points
1344 Posts
Re: Multiple Timers - Only on is ticking
Apr 27, 2007 04:47 PM|LINK
Hi Daikoku,
as discussed in http://forums.asp.net/thread/1648410.aspx, the Ajax timers get reset on postback (even if they are in different update panels). I think they have only begun delving into the potential of these controls. I do not know that there is anything you can do about this behavior at this time.
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." ~ Douglas Adams
Garbin
Contributor
7428 Points
1507 Posts
ASPInsiders
Re: Multiple Timers - Only on is ticking
Apr 27, 2007 06:57 PM|LINK
Hi,
as soon as you put the Timers into the UpdatePanels, they will be reset after a partial postback.
Have you tried putting the Timers outside the UpdatePanels and referencing them as AsyncPostBack triggers?
Daikoku
Member
13 Points
33 Posts
Re: Multiple Timers - Only on is ticking
Apr 30, 2007 07:48 PM|LINK
Garbin
Contributor
7428 Points
1507 Posts
ASPInsiders
Re: Multiple Timers - Only on is ticking
Apr 30, 2007 08:40 PM|LINK
Hi,
if the timers are placed outside the UpdatePanel, you should add them as AsyncPostBack triggers for the UpdatePanel.
Daikoku
Member
13 Points
33 Posts
Re: Multiple Timers - Only on is ticking
May 01, 2007 08:39 AM|LINK
pixelsyndica...
Star
7826 Points
1344 Posts
Re: Multiple Timers - Only on is ticking
May 01, 2007 03:06 PM|LINK
Here is a solution I was able to use. Perhaps this will help someone visualize it. I have two timers counting off; 1 counts seconds, the other counts 60 seconds. each triggers an update panel which adds a number to a labels current integer value and re-enabled the calling trigger.
// codebehind protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Label1.Text = "0"; Label2.Text = "0"; } } protected void Timer1_Tick(object sender, EventArgs e) { int Time1 = Convert.ToInt16(Label1.Text); Time1 += 1; Label1.Text = Time1.ToString(); if (Time1 >= 120) // stop the timer after two minutes ((Timer)sender).Enabled = false; else ((Timer)sender).Enabled = true; } protected void Timer2_Tick(object sender, EventArgs e) { int Time2 = Convert.ToInt16(Label2.Text); Time2 += 1; Label2.Text = Time2.ToString(); ((Timer)sender).Enabled = true; }ajax trigger Update Panel
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." ~ Douglas Adams
vihangshah.i...
Member
7 Points
6 Posts
Re: Multiple Timers - Only on is ticking
Aug 06, 2012 05:59 PM|LINK
Thanks a lot man.. You saved a lot time of mine.. You are life saver.. Thanks a again..
@VHNG
http://vihang-shah.blogspot.com/
chetan.sarod...
All-Star
65739 Points
11138 Posts
Re: Multiple Timers - Only on is ticking
Aug 07, 2012 03:17 AM|LINK
Refer this
http://encosia.com/aspnet-ajax-timer-trouble-location-is-key/
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.