How to implement timer in asp.net application?
-
Hi friends... We are developing online exam webpage using asp.net. When the exam starts (When page loads at the first time), duration of test will be displayed( for example: for 30.00). As the time passes on the duration would be decreased like 29.59, 29.58.... We are displaying one question per page. When user clicks on next button for next question, the timer is getting refreshed like displaying 30.00 again. we are displaying time in
tag client side. The issue is the timer value should not be refreshed when the user clicks on next button or previous button. Please shed some light on this so that I can get rid of this issue. Thank you, Shah_Tech
-
Hi friends... We are developing online exam webpage using asp.net. When the exam starts (When page loads at the first time), duration of test will be displayed( for example: for 30.00). As the time passes on the duration would be decreased like 29.59, 29.58.... We are displaying one question per page. When user clicks on next button for next question, the timer is getting refreshed like displaying 30.00 again. we are displaying time in
tag client side. The issue is the timer value should not be refreshed when the user clicks on next button or previous button. Please shed some light on this so that I can get rid of this issue. Thank you, Shah_Tech
Why don't you use ajax panel to diplay the date and put the timer outside the update panel? If you cannot use ajax for some reason or the other, then check if you can get the current value of the timer on the post back and set it as the timer starting value in the next page. Otherwise, use frames! Not advisable! HTH!!
-
Hi friends... We are developing online exam webpage using asp.net. When the exam starts (When page loads at the first time), duration of test will be displayed( for example: for 30.00). As the time passes on the duration would be decreased like 29.59, 29.58.... We are displaying one question per page. When user clicks on next button for next question, the timer is getting refreshed like displaying 30.00 again. we are displaying time in
tag client side. The issue is the timer value should not be refreshed when the user clicks on next button or previous button. Please shed some light on this so that I can get rid of this issue. Thank you, Shah_Tech
You need to keep the time value safe. This can be done as 1. Keep the hidden TextBox(Style="display:none") on the web page 2. Save the initial value of exam in the text box 3. For your timer control, fetch the timer value from this text box, subtract the value, display it to user and save the reduced value back in the text box. 4. When user clicks on the next button, fetch the value from the text box, pass it to the next page, save it in Hidden text box and start the timer from value in text box. I think this will help you.
Regards Aman Bhullar www.arlivesupport.com[^]