Creates a timer, with an ID, that will trigger a client function on a time interval.
For example, you can use the next lines:
Server Side:
// create a timer
CreateTimer("timerID", "myClientFunction", 2000);
// cancel a timer
CancelTimer("timerID");
See also live
CreateTimer/CancelTimer Example.
CreateTimer,
CancelTimer - server function
Creates a timer, with an ID, that will trigger a server function on a time interval.
For example, you can use the next lines:
Server Side:
// create a timer
CreateTimer("timerID", "myServerFunction", "myClientFunction", 2000);
// function that will be called at every interval
// and which can return something that myClientFunction can process
public string myServerMethod()
{
return "some result";
}
Client Side:
// function that will be called with the result of serverFunctionToCall
function myClientFunction(result, ex)
{
// if there was no error
if (ex == null)
{
// process response here
alert("Data received from the server on a time interval: " + result);
}
}
See also live
CreateTimer/CancelTimer Example.