954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

ASP Timer control JS garbage

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!

gazbg84
Newbie Poster
3 posts since Apr 2011
Reputation Points: 10
Solved Threads: 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/

platinum8
Junior Poster
Banned
107 posts since Jul 2008
Reputation Points: 1
Solved Threads: 3
Infraction Points: 10
 
http://disturbedbuddha.wordpress.com/2007/11/26/controlling-the-aspnet-timer-control-with-javascript/

I do not see the relevanceo of the post. I do not want to add or edit the Timer control with JS. I do not use JS to add a TimerControl the code that i posted is generated from the TimerControl itself, bacause i have not written any JS to insert a Timer Control.

gazbg84
Newbie Poster
3 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: