1. Register AjaxControlToolkit dll
< %@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" % >
2. Place a Script Manager
< asp:ScriptManager ID="ScriptManager1" runat="server" / >
3. Put this code on the aspx page
< div >
< asp:UpdatePanel ID="UpdatePanel2" runat="server" >
< ContentTemplate >
< div id="divTimer" runat="server" >
< /div >
< cc1:AlwaysVisibleControlExtender HorizontalSide="Right" VerticalSide="Top" ID="AlwaysVisibleControlExtender1" TargetControlID="divTimer" runat="server" >
< /cc1:AlwaysVisibleControlExtender >
< asp:Timer runat="server" ID="timer1" Interval="1000" >< /asp:Timer >
< /ContentTemplate >
< /asp:UpdatePanel >
< /div >
4. Put the VB code in Code Behind
Protected Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles timer1.Tick
divTimer.InnerHtml = "Current Time is : " & Now.ToLongDateString & " " & Now.ToLongTimeString & ""
End Sub
No comments:
Post a Comment