Hi indradeo,
Please refer below sample code.
HTML
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="lblTime" runat="server"></asp:Label>
<asp:Timer ID="Timer1" runat="server" OnTick="OnTime" Interval="1000">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if(!this.IsPostBack)
{
lblTime.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt");
}
}
protected void OnTime(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt");
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
lblTime.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt")
End If
End Sub
Protected Sub OnTime(ByVal sender As Object, ByVal e As EventArgs)
lblTime.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt")
End Sub
Screenshot