0

Hi,

I am having a Timer control like this:

asp:Timer ID="Timer1" runat="server" Enabled="False" Interval="1000" OnTick="Timer1_Tick">                                                                              </asp:Timer>

In an UppdatePanel with AJAX enabled.
So everything works fine to the point where on each refresh of the panel a JS is inserted in the header:

<script type="text/javascript">Sys.Application.add_init(function() {     $create(Sys.UI._Timer, {"enabled":true,"interval":1000,"uniqueID":"Timer1"}, null, null, $get("Timer1")); });</script>

So you can imagine in 10 min the page is increased by 600 lines.

Any ideas on how to make the timer not register itself every time or at least not stack up ?

Thanks!

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by joshhan
0

Hi,

I am having a Timer control like this:

asp:Timer ID="Timer1" runat="server" Enabled="False" Interval="1000" OnTick="Timer1_Tick">                                                                              </asp:Timer>

In an UppdatePanel with AJAX enabled.
So everything works fine to the point where on each refresh of the panel a JS is inserted in the header:

<script type="text/javascript">Sys.Application.add_init(function() {     $create(Sys.UI._Timer, {"enabled":true,"interval":1000,"uniqueID":"Timer1"}, null, null, $get("Timer1")); });</script>

So you can imagine in 10 min the page is increased by 600 lines.

Any ideas on how to make the timer not register itself every time or at least not stack up ?

Thanks!

http://disturbedbuddha.wordpress.com/2007/11/26/controlling-the-aspnet-timer-control-with-javascript/

0

I don't suppose you ever found a solution for this?

I'm experiencing the same exact issue of a usercontrol with a timer control in it creating duplicate javascript calls to the timer whenever it fires.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.