I'd like to embed a partial page in a Razor page that will show then number of seconds remaining once a timer has been started. The number of seconds would begin at say 100 seconds and should update every 10 seconds on the partial page without causing the
parent Razor page to update. This is for a quiz application with a number of Razor pages and if the questions of the first page are completed the user would move to the second page which would also include the partial which would continue to show the number
of seconds remaining for the whole quiz. Can anyone point me in the right direction please.
1. Use setInterval() function. Simply give this function a callback and a timeout period (in milliseconds) as arguments and
it will call your function every X milliseconds. Use Ajax to dynamically load the partial view :
2. After the first time partial view loaded .Directly update the html/element of the view using JavaScript with timer , not need to use ajax to load the partial view again .
Best Regards,
Nan Yu
Marked as answer byAnonymousThursday, October 7, 2021 12:00 AM
1. Use setInterval() function. Simply give this function a callback and a timeout period (in milliseconds) as arguments and
it will call your function every X milliseconds. Use Ajax to dynamically load the partial view :
2. After the first time partial view loaded .Directly update the html/element of the view using JavaScript with timer , not need to use ajax to load the partial view again .
Best Regards,
Nan Yu
Marked as answer byAnonymousThursday, October 7, 2021 12:00 AM