Link to home
Start Free TrialLog in
Avatar of feesu
feesu

asked on

ASP.NET - Countdown timer

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?
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

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.
ASKER CERTIFIED SOLUTION
Avatar of Anuradha Goli
Anuradha Goli
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial