locked
Idle time in Timer RRS feed

  • Question

  • User-1426568392 posted

    I have a timer in my application for 1 minute, It refreshes after 1 minute,
    but i dont want to call Timer after one minute, while i am doing some thing in the page.

    So my objective is get the idle time suppose 2 minutes then i have to call the timer.

    How can i achive this.

    Wednesday, January 24, 2018 12:38 PM

All replies

  • User283571144 posted

    Hi sth_syed,

    sth_syed

    I have a timer in my application for 1 minute, It refreshes after 1 minute,
    but i dont want to call Timer after one minute, while i am doing some thing in the page.

    So my objective is get the idle time suppose 2 minutes then i have to call the timer.

    According to your description, I couldn't understand your requirement clearly.

    Do you mean you want change the timer Interval time after first timer fired?

    I mean first timer is called one minute, then the second timer is called two minutes.

    If this is your requirement, you could try to use below codes:

            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:Timer ID="Timer1" runat="server" Interval="10000" OnTick="Timer1_Tick"></asp:Timer>
            protected void Timer1_Tick(object sender, EventArgs e)
            {
                Timer1.Interval = 2000;
                Response.Write("fired");
            }

    Best Regards,

    Brando

    Thursday, January 25, 2018 5:27 AM