Click here to Skip to main content
15,891,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I wanna diplay a Stopwatch timer ...using Asp.Net C#...

I reffer many threads and searched in google also...
But cant find proper code or solution..
Most of the solutions i found were very hard to implemnt and some of didnt worked...

I want to create stopwatch like...

00.00
which is HH.MM



In this by clicking on start button in starts the watch from 00.00

and change the text of Button to Stop.
And by click on that again it Stops the watch..
And Then Save that time in database and also display in given TextBox....
by click on Reset it resets the time to 00.00..


I haven't any idea about this
so require some code as suggestion..
Posted

 
Share this answer
 
See the below link for similar question

How to implement countdown timer in asp.net using c#[^].

Thanks
--RA
 
Share this answer
 
Comments
Aniket Yadav 10-Feb-12 2:43am    
The Above Solutions Provided By Khushwant And Rajesh Will Definitely Help You.

Thanks Both Of You For Ur Solution
XML
<!DOCTYPE html>
<html>
<body>

<p>Click the first button to display the current time, and the second button to stop the time.</p>
<button onclick="myFunction()">Try it</button>
<button onclick="myStopFunction()">Stop time</button>

<script type="text/javascript">
var myVar;

function myFunction()
{
myVar=setInterval(function(){myTimer()},1000);
}

function myTimer()
{
var d=new Date();
var t=d.toLocaleTimeString();
document.getElementById("demo").innerHTML=t;
}

function myStopFunction()
{
clearInterval(myVar);
}
</script>

<p id="demo"></p>

</body>
</html>
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900