Refreshing a page periodically

Refreshing a page periodically

  
Hi guys.

I would like to periodically refresh a page. I have a variable that determines the frequency. Its a session variable. But no matter the default value of the session variable  it always fires the true part.

The script is below. Any advice would be appreciated.

function RefreshMaintainIncidents()
    {
        var IsHyperRefresh = '<%= Session["IsHyperRefresh"] %>';
        
        if (IsHyperRefresh)
        {
            setTimeout("location.reload(true);", 1 * 10000);
        }
        else
        {
            setTimeout("location.reload(true);", 1 * 60000); 
        }
    }
    RefreshMaintainIncidents();
You can pass the Session value as a function parameter. Put the script on the page and call the function in a expanded inline expression passing your Session variable as parameter (by concatenating the string) like this:

"<script>RefreshMaintainIncidents("+Session.IsHyperRefresh+");</script>"

Hope it helps.