1

I have an Timer on my webpage and for testing I filled its onTick event with an Respose.Redirect.

    <asp:UpdatePanel runat="server">
        <ContentTemplate> 
            <asp:Timer ID="tiUpdater" runat="server" OnTick="GetTime" Interval="1000" />
        </ContentTemplate>
    </asp:UpdatePanel>


    protected void GetTime(object sender, EventArgs e)
    {
        Response.Redirect("~");
    }

I discovered that if I have my page open in a second tab, both pages refresh each second but after I click in one tab any button, the timer on the second page stops refreshing.

Do you have an explanation for this behaviour?

Abdul
  • 2,002
  • 7
  • 31
  • 65
MaxW
  • 421
  • 1
  • 7
  • 22
  • The information in this question is not enough to give an answer, try pasting the entire code behind if you can. There is probably something "static" going on. – Sumit Maingi Jun 28 '16 at 09:17

2 Answers2

0

Give more info pls, past the entire code behind if you can.

I would suggest you try the Javascript nonetheless, there is no need for the server to recieve a call just to refresh the page.

See this for the JS solution: How to automatically reload a page after a given period of inactivity

In case you are targeting an environment where JS cannot be enabled, try the meta tag way:

<meta http-equiv="refresh" content="5; URL=http://www.yourdomain.com/yoursite.html">

5 is seconds here.

Community
  • 1
  • 1
Sumit Maingi
  • 2,173
  • 3
  • 24
  • 44
0

I'm not sure about your problem but maybe try to set propertie AutoReset to true

A.Pissicat
  • 3,023
  • 4
  • 38
  • 93