Timer does not stop firing

I am using a webtimer to update a progress dialog while a thread (TOUCalc) runs. When the thread finishes, it kills the thread and runs one of two methods to display the results from the thread. My problem is that the “me.Mode = Timer.ModeOff” appears to be ignored and the timer fires repeatedly.

Sub Action() Handles Action ProgressDialog.bar.Value = TOUCalc.iCount if ProgressDialog.Bar.Maximum <= ProgressDialog.bar.Value Then ProgressDialog.Close TOUCalc.Kill if TypeIndex = 12 Then FinishTOU Else FinishTOUDetail end if me.Mode = Timer.ModeOff end if End Sub
I have set a breakpoint where the webtimer is activated and there is no reference to the timer in either FinishTOU or FinishTOUDetail. I have moved the “me.Mode =” line to different places within the “if…end if” with no change in result. I have changed the super from WebTimer to Timer and still no change. Suggestions for a different approach are most welcome.

Use a server side timer instead of the WebTimer.

Drag a Generic Object to the webpage and make its super Timer (NOT WebTimer). Then use just the same.

That is a good workaround indeed.

But the question remains, why doenst the timer stop?

The WebTimer is based on JavaScript. So basically it executes in the browser. I have no idea what the exact cause is, but I do know that the server side timer executes on the server like in Desktop, which makes it far faster and responsive.