Click here to Skip to main content
11,704,768 members (45,083 online)
Rate this: bad
good
Please Sign up or sign in to vote.
I want to create a clock on my ASP.NET page that display a time without refreshing the page
Posted 15-Sep-11 0:29am
Edited 17-Sep-11 0:53am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Depending on what you are actually going to use it for, wouldn't a simple javascript timer work - see this[^] for example
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 8

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function TimeToShow() {
            var dt = new Date();            
            var la = document.getElementById("<%= Timer.ClientID %>");
             la.innerHTML = dt.toLocaleTimeString();
            window.setTimeout(TimeToShow, 1000);          
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:label id="Timer" runat="server" text="Timer">
    <asp:button id="btnStart" runat="server" text="Start"/>    
    </div>
    </form>
</body>
</html>
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

You try this link

Only time In Asp.net[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

By Jquery or Ajax u can show Time
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 12

Search as Convas control in w3school.com
lot of option are available on net....
  Permalink  
Comments
CHill60 at 21-Jul-15 5:34am
   
"lot of option are available on net...." - yes there are, including the other 7 solutions that were posted over 3 years ago. If you are not going to add useful information then I advise you to avoid answering old posts in this way

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 679
1 OriginalGriff 455
2 Andy Lanng 245
3 CPallini 242
4 Maciej Los 225
0 OriginalGriff 8,864
1 Sergey Alexandrovich Kryukov 8,245
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 21 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100