I currently have a webpage built with ASP.Net that includes an ASP:Timer control
<asp:Timer ID="TimerRefresh" runat="server" Interval="5000" Enabled="true" OnTick="TimerRefresh_Tick">
</asp:Timer>
It is connected to an asp:UpdatePanel on the page, allowing for a specific section of the page to refresh asynchronously.
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="TopRow" id="TopRowPlace" runat="server">
... Additional HTML Code goes here...
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="TimerRefresh" />
</Triggers>
</asp:UpdatePanel>
An issue arises when the DIV tag containing the dynamically updated HTML can be hidden by changing the display property to none due to certain user actions. In such cases, there is no need for the content to be updated since it's not visible.
Is there a way in JavaScript to stop the timer from triggering the asynchronous post-back, and then re-enable it once the DIV tag becomes visible again?