Javascript event for Atlas page load

Discussion in 'ASP .Net' started by Surya Vellanki, Mar 26, 2007.

  1. 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
    --
    Satish Vellanki
     
    Surya Vellanki, Mar 26, 2007
    #1
    1. Advertising

  2. On Mar 26, 11:53 pm, "Surya Vellanki" <> wrote:
    > Hi all,
    >
    > I have been struggling with this problem from a few days. I hope I
    > will get some help here.


    [snip]
    I could help you, but you're not gonna like the answer... ;)

    Ditch ASP.NET Ajax and use a REAL ajax framework...

    http://ajaxwidgets.com/AllControlsSamples/Timer.aspx

    ..t
     
    Thomas Hansen, Mar 26, 2007
    #2
    1. Advertising

  3. 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();
    }

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    http://SteveOrr.net


    "Surya Vellanki" <> wrote in message
    news:...
    > 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
    > --
    > Satish Vellanki
    >
     
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Mar 27, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    2,985
  2. Replies:
    0
    Views:
    1,716
  3. Replies:
    0
    Views:
    640
  4. GauravGupta
    Replies:
    4
    Views:
    2,154
    Shilpa1234
    Jan 19, 2012
  5. Matcon
    Replies:
    3
    Views:
    21,725
    Matcon
    May 28, 2008
Loading...

Share This Page