Download Now Code Base AsyncDocs Contact Us
asyncPageTimer
liveDemo
  • Clicking "Start Timer" will begin to count using the specified interval. Each timer tick event will display the current time.
  • Clicking "Stop Timer" stops the timer. You may change the interval to any value between 1000 and 5000 (ms).
  • Clicking "Update Tick Interval" will update the interval of each server-side tick event (while the timer is enabled).

Interval: (ms)

Click "Start Timer" when ready.

Description

The AsyncTimer is a simple Async-Enabled timer server control.



Features
  • Easily start and stop during AsyncCallbacks.
  • Allows you to easily receive OnTick events.
  • Use the Tag property to transfer objects between OnTick events.
  • Change the tick interval during an AsyncCallback.
   
<%@ Register Assembly="AsyncControls" Namespace="DelvingWare.AsyncControls" TagPrefix="dw" %>

<%@ Register Assembly="AsyncControls" Namespace="DelvingWare.AsyncControls.Utils" TagPrefix="dw" %>

<dw:AsyncTimer runat="server" ID="tmrMain" Interval="1000" OnTick="tmrMain_Tick" />

<p>
<dw:AsyncButton runat="server" ID="btStart" 
Text="Start Timer" 
CausesValidation="true" 
OnClick="btStart_Click" 
DisableDuringCallback="false" 
CssClass="greyButton"/>

<dw:AsyncButton runat="server" ID="btStop" 
Enabled="false" 
Text="Stop Timer" 
OnClick="btStop_Click" 
DisableDuringCallback="false" 
CssClass="greyButton"/>
</p>

Interval: <dw:AsyncTextBox runat="server" ID="txtInterval" 
Size="3" 
MaxLength="4"
EnableValidation="enabled" 
MultiValidate="Range|RequiredField"
ErrorMessageCssClass="errorMsg" 
ErrorMessage="Please enter a valid timer interval. 1000 - 5000 "
MinimumValue="1000" 
MaximumValue="5000"
Text="1000" />(ms)
<br/>
<dw:AsyncLinkButton runat="server" ID="lnkMain"
OnClick="lnkMain_Click"
CausesValidation="true"
Visible="false"
Text="Update Tick Interval" />

<dw:AsyncLabel runat="server" ID="lblMain" RenderMode="paragraph">Click "Start Timer" when ready.</dw:AsyncLabel>