America/US Samples
Europe Samples
Asia Samples

Gaia Ajax: Timer

This is our Ajax Timer Control. The Gaia Ajax Timer will poll the server raising an event handler every n'th second according to which interval you have configured it to do so. It can be disabled and enabled from the server and from the Event Handler you can do whatever you wish with other controls on the page. Including creating new controls and update existing ones.

Server CPU Usage (updates every 2 sec):

-

The CPU Usage information is only based on random data Try to click the Button to disable and enable the Timer. Use the Timer if you need to periodically check the server for changes you need to display back to the user. The Ajax Timer is often used in e.g. Chat Controls like our own Ajax Chat Control for polling the server to check for new messages.


Markup (ASPX/.aspx)

   1:   
   2:      <p>Server CPU Usage <small>(updates every 2 sec)</small>:</p>
   3:   
   4:      <div style="float:left;">
   5:          <gaia:Label 
   6:              ID="Label1" 
   7:              runat="server"
   8:              Font-Size="100"
   9:              Text = "-" />
  10:      </div>
  11:      <div style="float:right;">
  12:          <gaia:Slider 
  13:              runat="server" 
  14:              Enabled="false"
  15:              DisplayDirection="Vertical"
  16:              Height="200px"
  17:              ID="slider"
  18:              Value="100"
  19:              CssClass="gaiax" />
  20:      </div>
  21:      
  22:      <br style="clear: both;" />
  23:      
  24:      <gaia:ExtendedButton
  25:          ID="Button1" 
  26:          runat="server" 
  27:          CssClass="gaiax"
  28:          style="width: 100px;"
  29:          OnClick="Button1_Click" 
  30:          Text="Pause" />
  31:   
  32:      <gaia:Timer 
  33:          ID="Timer1" 
  34:          Milliseconds="2000"
  35:          runat="server"
  36:          OnTick="Timer1_Tick" />
  37:   
  38:      <p>
  39:          <b style="color:Red;"> The CPU Usage information is only based on random data </b>
  40:          Try to click the Button to disable and enable the Timer. Use the Timer if you need to periodically check 
  41:          the server for changes you need to display back to the user. The Ajax Timer is often used in e.g. Chat Controls
  42:          like our own <a href="../../../Combinations/WebApps/ChatControl/">Ajax Chat Control</a> for polling the server to check for new messages.
  43:      </p>
  44:   
  45:   
  46: