Reputation: 737
How to show a running time with seconds in c# web form application on a label? I tried to find it but unfortunately failed. However I found help for the win form application but not for web form. Any help would be appreciated.
Upvotes: 0
Views: 481
Reputation: 183
For the web page you should use javascript/jquery to show or calculate the time: Here is an example:
<!DOCTYPE html>
<html>
<body>
<p>A script on this page starts this clock:</p>
<p id="demo"></p>
<script>
var myVar = setInterval(myTimer, 1000);
function myTimer() {
var d = new Date();
document.getElementById("demo").innerHTML = d.toLocaleTimeString();
}
</script>
</body>
</html>
Upvotes: 1
Reputation: 2169
You shoul use Javascript if you want the timer in the client side (browser).
For example: http://flipclockjs.com/
Upvotes: 1