Auto update time in page in the top corner

Satyadevanand
Posted by Satyadevanand under ASP.NET category on | Points: 40 | Views : 2192
Time will automatically updated
ASP page
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="float:right;border:solid 1px blue">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:Label ID="Label3" runat="server" Text="Time" ForeColor="#d0224e"></asp:Label>
<asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
</div>


C#
    protected void Timer1_Tick(object sender, EventArgs e)
{
Label3.Text = DateTime.Now.ToString();
}

Comments or Responses

Login to post response