Hi akhter,
You have not set the OnTick event for Timer control.
Check the below code.
HTML
<asp:ScriptManager runat="server" />
<asp:UpdatePanel ID="Panel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lbitemtotal" runat="server" Font-Bold="True" Font-Size="75pt" ForeColor="#FF3300"
Text="." Width="108px" Height="98px"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="GetTime">
</asp:Timer>
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
lbitemtotal.Text = DateTime.Now.ToString("hh:mm:ss tt");
}
}
protected void GetTime(object sender, EventArgs e)
{
lbitemtotal.Text = DateTime.Now.ToString("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
lbitemtotal.Text = DateTime.Now.ToString("hh:mm:ss tt")
End If
End Sub
Protected Sub GetTime(ByVal sender As Object, ByVal e As EventArgs)
lbitemtotal.Text = DateTime.Now.ToString("hh:mm:ss tt")
End Sub
Screenshot