Javascript countdown timer reset when page refresh
-
Hi, I set the countdown timer of javascript. my problem is that when i refresh the page or it's postback by any control, my timer is reinitialize again. plz reply me if there is any solu. asap.
Farogh Haider Web developer
-
Hi, I set the countdown timer of javascript. my problem is that when i refresh the page or it's postback by any control, my timer is reinitialize again. plz reply me if there is any solu. asap.
Farogh Haider Web developer
farogh123 wrote:
when i refresh the page or it's postback
You have to store the value before postback. You can store it in View State. :)
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article
-
Hi, I set the countdown timer of javascript. my problem is that when i refresh the page or it's postback by any control, my timer is reinitialize again. plz reply me if there is any solu. asap.
Farogh Haider Web developer
Store the timer value in a hidden variable in the onbeforeUnload event of body element using javascript. This event will be fired before a postback. Write some code to start the timer from the hidden field value in the onload event of body. This event will be fire after postback.