Jay Kimble -- The Dev Theologian

Sponsors

The Lounge

Syndication

News

  • CodeBetter.Com Home
    Current Threat level
    Terror Alert Level

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
MS Ajax - Server Timer's Script interface

Lately, I've been hacking my way around the script enhancements in MS Ajax. I have a couple contracts that have had me doing this. I just had to make a call to dynamically raise a tick event from script for a MS Ajax Timer (server control). As a result I had to hack on the Timer control a little and thought I would pass on to the world (and for my reference) the interface. Most of the methods are marked don't use and all are pretty much private (but javascript has no concept for private, so you can actually call anything in the object's interface.

Sys.UI._Timer
properties
- enabled - Boolean - controls the flag indicating whether the timer is enabled or not (you probably shouldn't be setting this; use the _update instead)
- interval - Numeric - controls the amount of time in milliseconds between timer ticks - default is 60000 or 1 minute (you probably shouldn't be setting this; use the _update instead)
- uniqueID - String - Timer Component's Unique ID (you shouldn't need to set this)

methods

- dispose() - disposes/destroys the component (you probably shouldn't be calling this)
- _doPostback() - causes the postback (again, you probably shouldn't be calling this)
- _handleEndRequest(sender, arg) - internal event (don't use)
- initialize() - creates internal structures/activates the timer (you won't need to call this if you are using the server timer)
- _raiseTick() - raises a server tick event (this is private -- because the name starts with an underscore-- but you can probably call this... I am)
- _startTimer() - starts the timer (this is also private, but it appears to be safe to call)
- _stopTimer() - stops the timer (private, but it appears to be safe to call)
- _update(enabled,interval) - safely updates the enabled and interval properties; if you set properties then you will need to call _stopTimer and _startTimer (private, but it appears to be safe to call)

kick it on DotNetKicks.com

Technorati Tags: , , ,


Posted 03-02-2007 8:16 PM by Jay Kimble
Filed under: ,

[Advertisement]