Reset the MS AJAX TimerControl's countdown.

by JoeStagner 10/20/2006 7:32:01 AM
Are you using a MS AJAX timer control to auto refresh content on your page but want to reset the timer when a user action forces a refresh. In your server side code you can reset the timer by adding two lines like this: Protected Sub ButtonResetTimer_Click(ByVal sender As Object, ByVal e As System.EventArgs) TimerControl1.Enabled = False TimerControl1.Enabled = False End Sub

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Related posts

Comments

10/23/2006 7:57:50 AM

Hi Joe-

Presumably the second line in the sub should be "TimerControl1.Enabled = True" not "TimerControl1.Enabled = False" (you currently set Enabled to False twice).

-Don

Don

1/23/2008 10:23:34 AM

Hey Joe,

My application has a Multiview with 6 views. If I move from view 1 to view 2, a savedata event is run. If nothing is happening and the timer interval value is reached, the same savedata routine is run.

When the user clicks the Next button, to advance to View 2, i want to reset the timer.

I put a Timer1.enabled = False before the SaveData event and Timer.enabled = true after it. But it does not listen. If I only set the Timer1.enabled = False and do not set it back to True, it is in fact disabled.

Any Ideas ?

thanks

Howard Katz

Howard Katz

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About your host.

Name of author Joe Stagner
?????

E-mail me Send mail

Calendar

<<  September 2008  >>
MoTuWeThFrSaSu
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

View posts in large calendar

Pages

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in