Website timer tick makes buttons unresponsive
Posted on 2014-08-28
I have a ASP.NET C# website which has a timer that ticks every 0,8 seconds. When it ticks, it gets a value from an SQL database, and updates a textbox (which is in an UpdatePanel) with the new value. This part works well, and the value on the screen is updated fairly smoothly. I disable the timer at the start of its tick and enable it again when the value in the textbox have been updated to avoid "double-ticks" if the sql server responds to slow.
My problem is that I have several buttons on my site, and they do not always responed when they are clicked. If I increase the time between timer ticks, the problem with unresponsive buttons goes away, so I supect that the unresponsiveness of the buttons are due to the site being busy with handling the timer tick.
UPDATE: The buttons DO respond to clicks, but with the timer set to 0,8 seconds, they respond very slowly (I guess they are waiting for the timers Tick event to finish).
Is there a way around this? I cannot make the timer tick less frequently, as I need the value from the database to be shown in as "real time" as possible.