Timer.Interval Property


Gets or sets the number of milliseconds to wait before initiating a postback.

Namespace:   System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

member Interval : int with get, set

Property Value

Type: System.Int32

The number of milliseconds to wait before initiating a postback. The default value is 60,000 (60 seconds).

Exception Condition

The specified value is less than or equal to zero.

Use the Interval property to set how often the Timer control initiates a postback to the server. You can change the value of the Interval property in server code after a postback, such as in an event handler for the Tick event. The accuracy of when the Timer control posts back to the Web server depends on the accuracy of the ECMAScript (JavaScript) window.setTimeout function that runs in the browser.


Setting the Interval property to a small value can generate significant traffic to and from the Web server. Use the Timer control to refresh the content only as often as necessary.

When you change the value of the Interval property, the ECMAScript timing code running in the browser will be reset when the updates are rendered.

The following example shows an UpdatePanel control that displays a randomly generated stock price and the time that the stock price was generated. By default, the Timer control updates the content in the UpdatePanel control every 10 seconds. The user can decide to update the stock price every 10 seconds, every 60 seconds, or not at all. The Interval property is set to the user's choice.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5
Return to top