Ajax Timer loading problem
I am using ajax timer in my program for an online test application. Program working as expected.
However Ajax timer is calculating the page load time also. For example if I allocate 20 seconds to one question, after the page load user will get less time than 20 seconds as it开发者_JAVA技巧 will calculate the loading time.
Is there any way I can disable the timer and enable it again only after the full page load. Or is there any C# code to find out whether the page is fully loaded or not??
Thanks, Jithu
This is expected behavior. The timer's placement within a container determines the amount of time it takes to trigger between intervals. For instance, if it's placed within an UpdatePanel it will take take the time to load the contents of the UpdatePanel after the first trigger + the interval to set the next interval.
If the timer exists on the main page itself, and it's the Load event that takes a long time to process, you could then try
doing timer.Start()
on the OnLoadComplete
event of the page.
精彩评论