Click here to Skip to main content
15,884,022 members
Articles / Web Development / ASP.NET

Web Timer Control

Rate me:
Please Sign up or sign in to vote.
4.00/5 (11 votes)
7 Oct 2008GPL33 min read 58.8K   1.4K   38  
Provides a mechanism for executing a method at specified intervals
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ManualStart.aspx.cs" Inherits="ManualStart"  Title="Manual Start" %>
<%@ Register Namespace="CodeControls" TagPrefix="cc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
   <h2>Manual Start</h2>
    <div>    
    <table style="color:Green;font-weight:bold">
    <tr>
    <td colspan="2" style="text-decoration:underline">Timer Settings</td>    
    </tr>
    <tr>
    <td align="right"> AutoStart:</td><td><asp:Label ID="lbAutoStart" runat="server"/></td>    
    </tr>
    
     <tr>
    <td align="right"> PostBack On TimeOut:</td><td><asp:Label ID="lbPostBack" runat="server"/></td>    
    </tr>
    
    <tr>
    <td align="right"> Disable Mouse Right Click: </td><td><asp:Label ID="lbMouseClick" runat="server"/></td>    
    </tr>
    
    <tr>
     <td align="right"> Sync Clock With Server: </td><td><asp:Label ID="lbSyncTimer" runat="server"/></td>    
    </tr>
    </table>
    
    <br />
    <br />
     <cc:Timer ID="Timer1" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="48px" ForeColor="#FF8000"
     Interval="5" IsAutoStart="False" DisableRightClick="False" DoPostBackOnTimeOut="False" ServerSideTimeSynchronize="True" TimeOut="24" 
     OnIntervalReached="Timer1_IntervalReached" OnTimeOutOccurred="Timer1_TimeOutOccurred"
     ></cc:Timer><br />
        <br />
        &nbsp;<br />
        <br />
        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Start Timer" />
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Create PostBack" /></div>
</asp:Content>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
United States United States

Comments and Discussions