Javascript event for Atlas page load

S

Surya Vellanki

Hi all,

I have been struggling with this problem from a few days. I hope I
will get some help here.

I am developing an online quiz portal with ASP.NET 2.0 and I am using
Atlas framework for rich UI.

I was in need of a timer control which keeps track of the quiz time
and sends a post back when the time expires!
For this purpose I am using Cronometro control by Manuel Abadia in
Code Project (http://www.codeproject.com/aspnet/dhtml_timer.asp)

Now the issue is that when there is an AJAX postback I want the timer
to pause till the page reloads. I could pause this timer with
javascript but I dont see any way to unpause it when the page loads
back because it is an AJAX page load and I dont know if there is a way
to run javascript in this event.

Could some one tell me if there is a way to run javascript on AJAX
page reloads?
Another solution could be to use a different timer control which
automatically pauses on AJAX calls. If anyone knows of such a control
could you share with me?

I know I can do this without using AJAX/Atlas at all but I am trying
if I could

Thanks in advance
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

After an ASP.NET AJAX asynchronous postback you could use the Page Request
Manager's EndRequestHandler event to restart your timer.

So something along these lines should do it:

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
restartTimer();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top