RadWindow - Touch AJAX Timer in Parent Window

3 posts, 1 answers
  1. ataxia1
    ataxia1 avatar
    16 posts
    Member since:
    May 2007

    Posted 05 Aug 2008 Link to this post

    Trying to restart an AJAX timer running in the parent window whenever a RadWindow is closed with JavaScript.

    Here's a snippet of the js code on the window page:

    var oWindow = GetRadWindow();
    var timer = find$("ctl00_cphContent_RefreshTimer1");
    timer._startTimer();
    oWindow.Close();


    The window close works fine.  The find$ code works on a standard page, but I can't locate the parent page's timer from the windowed page's JavaScript.  Any idea what I can use to reference the timer control from inside the window?  I tried all the basics I could think of (e.g. document.GetElementById)

    Assuming I either need to drill back using a .parent or drill down from a window. but wasn't sure where to start.

    Thanks

    - Brad
  2. Answer
    Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 05 Aug 2008 Link to this post

    Hello,

    What you'll want to do is have the client-side function that restarts the timer on the parent page, and then call that function from the window.  So:

    On the parent page:

    function start_the_timer() {
      var timer = $find("<%= RefreshTimer1.ClientID  %>");
      timer._startTimer();
    }

    On the window page:

    var oWindow = GetRadWindow();
    oWindow.BrowserWindow.start_the_timer();
    oWindow.close();

    Hope that helps,

    Shaun.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ataxia1
    ataxia1 avatar
    16 posts
    Member since:
    May 2007

    Posted 06 Aug 2008 Link to this post

    Excellent.  Thanks for the help.
Back to Top