Performs asynchronous or synchronous Web page postbacks at a defined interval.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
The control enables you to perform postbacks at a specified interval. When you use the control as a trigger for an UpdatePanel control, the UpdatePanel control is updated by using an asynchronous, partial-page update. You must include a ScriptManager object in a Web page to use the control.
You use the control to update an UpdatePanel control by including the timer inside the UpdatePanel control. Alternatively, you can place the timer outside the UpdatePanel control and set the timer as a trigger.
You can also initiate full postback of a complete Web page by including the control in the Web page and not setting it as a trigger for an UpdatePanel control.
You can run server code when the timer interval has elapsed by creating an event handler for the Tick event. In the event handler, you can include code that dynamically adjusts the behavior of the control.
The Interval property is defined in milliseconds. You must set the Interval property to a value that lets at least one asynchronous postback complete before the next postback is initiated. When the control is outside an UpdatePanel control, the timer continues to run while the content of the UpdatePanel control is refreshed. If a new postback is initiated while an earlier postback is being processed, the first postback will be canceled. The default value is 60,000 milliseconds (60 seconds).
Adding a control with a small value in the Interval property can generate significant traffic to and from the Web server. Use the control to refresh the content only as often as necessary.
The following example shows an UpdatePanel control that displays a randomly generated stock price and the time that the stock price was generated. The control updates the content in the UpdatePanel control every 10 seconds.
In this example, the timer interval is set to 10 seconds so that when you run the example, you do not have to wait a long time to see the results. Because each timer interval causes a postback that causes network traffic, in a production application you should set the interval to the longest time that is still practical for your application.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.