Version: 1.6.3.0
Ajax technology accesses server-side power using callbacks without reloading the browser page. Easily create Rich Internet Applications without writing JavaScript!

LiveTimer ASP.NET Server Control Information

This page includes information about the LiveTimer Server Control, which is included in PowerWEB LiveControls for ASP.NET

[View LiveControl Demo]

The LiveTimer server control is used to periodically poll the server for new data. Set the Interval property and start the timer and a callback is issued to the server, raising the Timer.Tick event. Within this event, take whatever action you wish and update the client UI. All of this client/server communication occurs transparently, without any UI interruption or browser refresh. As a result, a static webpage can become "live": constantly and smoothly updated as new data is available on the server.

Remember! Any LiveControl which raises a callback to the server (such as LiveTimer) raises a server event within which ANY client-side element can be visually updated without refreshing the page!

The LiveTimer control has the following features:

  • Cross-browser compatible, no plugins, downloads, or security warnings.
  • Intuitive interface has Interval property and Start() and Stop() methods, exactly like Windows Timer.
  • Set Interval property to 0 and the Tick event is raised as often as possible (as often as network bandwidth allows), ideal for applications that require data refreshes as close to "real-time" as possible.
  • When used in browsers that don't allow remote scripting techniques, the ASP.NET __doPostBack function is called in place of the callback function to periodically issue a standard postback.

Some example uses for LiveTimer:

  • Build a web-chat application, using the LiveTimer to constantly poll for new chat messages.
  • "Stream" constantly updated data (such as sports scores, stocks, or weather conditions) to the browser.
  • Create a web-based email system that checks for new mail and displays messages when it arrives.
  • Make an online auction system that updates the current bids in real time.

Browser Compatibility

LiveControls have been tested and are fully "callback-compatible" in the following browsers:

  • Microsoft Internet Explorer 5.0+ for Windows
  • Microsoft Interner Explorer 5.0+ for Macintosh
  • Netscape 7.1+ for Windows
  • Netscape 7.1+ for Macintosh OS X
  • Mozilla 1.3+ for Windows
  • Mozilla 1.3+ for Macintosh OS X
  • Firefox for Windows
  • Firefox for Macintosh OS X
  • Camino for Macintosh OS X
  • Konqueror based engines
  • Galeon
  • Opera 5.0+

If a browser which is not compatible accesses a page containing LiveControls, the controls will fall back to the standard ASP.NET functionality. For example, a LiveButton issues a transparent callback when clicked. If on a non-compatible page, the button will still be displayed, but will cause a standard postback when clicked.

Server Tag Example

The following tags demonstrate typical settings for initializing and starting a LiveTimer

<cc1:LiveTimer id="LiveTimer" runat="server" Interval="100" Enabled="true">
</cc1:LiveTimer>

Code-Behind Example

The LiveTimer is also quite easy to configure/use in Code-Behind.

// Configure and start the timer
LiveTimer1.Interval = 100;
LiveTimer1.Start();

// Tick event raised every 100 milliseconds.
private void LiveTimer1_Tick(object sender, System.EventArgs e)
{
   // update a label with the current time
   LiveLabel1.Text = DateTime.Now.ToLongTimeString();
}