PostBack refreshes Javascript
-
Dear All, I have added a small piece of javascript code to create countdown timer in the Online Test aspx page. But whenever i click on next button in the aspx page the javascript also get refreshed and stops the countdown. As i need to navigate through the records and display the questions in the aspx page, i need to post back on click of next button. can you please guide me to proceed with the countdown timer in my aspx page.
Thanks and Regards, Sushanth_CP
-
Dear All, I have added a small piece of javascript code to create countdown timer in the Online Test aspx page. But whenever i click on next button in the aspx page the javascript also get refreshed and stops the countdown. As i need to navigate through the records and display the questions in the aspx page, i need to post back on click of next button. can you please guide me to proceed with the countdown timer in my aspx page.
Thanks and Regards, Sushanth_CP
So you're counting down to a certain time... Now if you keep this time (or datetime) in a session variable, you'll be able to calculate how to 'further-countdown' right?? This makes your javascript continue in stead of start over and over again...
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
So you're counting down to a certain time... Now if you keep this time (or datetime) in a session variable, you'll be able to calculate how to 'further-countdown' right?? This makes your javascript continue in stead of start over and over again...
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
Thanks for your reply. But how can i retrieve the value of the session variable into the javascript. Pls help me in this regard.
Thanks and Regards, Sushanth_CP
You can't, but you can set the session variable as javascript in your page... use the Page.ClientScript.RegisterClientScriptBlock function to write javascript to your page..
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
You can't, but you can set the session variable as javascript in your page... use the Page.ClientScript.RegisterClientScriptBlock function to write javascript to your page..
.: I love it when a plan comes together :. http://www.zonderpunt.nl
-
You can also access the session value in javascript by setting it to a hidden field and then access it in JS.