ASP.NET - Countdown timer

feesu used Ask the Experts™
Hello Experts,

I have an aspx page that I want upon clicking on a button, from code behind I assign a certain number of minutes to a timer on the page.

The time should be displayed on a label in the page with a countdown.

For example, if my code behind variable holds the value of "5", clicking the button will make the label.text = 5, then it should work like a stopwatch (4:59 etc..) until 0:00

Is that possible?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

You can set the variable in code behind, but using code behind to decrement the variable would be impractical since it would require a postback every second. Your best bet is to do the decrementing on the client side with javascript.
attach this code to button:-
Systems Development / Support Specialist
Please find attached code for Countdown timer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial