ASP.NET 简单实现数字时钟

每隔1000毫秒(1s)获取一次当前时间

<asp:ScriptManager ID="ScriptManager_Time" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel_Time" runat="server">
    <ContentTemplate>
        <asp:Label ID="Label_ShowTime" runat="server" Text="时间"></asp:Label>
        <asp:Timer ID="Timer_Time" runat="server" OnTick="Timer_Time_Tick" Interval="1000">
        </asp:Timer>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Timer_Time" EventName="Tick" />
    </Triggers>
</asp:UpdatePanel>
posted @ 2017-12-21 15:23  taadis  阅读(192)  评论(0编辑  收藏  举报