Refresh page automatically when accessing the system

5

I have a project, where I need the user to access the system, the system updates the page automatically, only once. I've found how to do this from time to time (5 in 5 seconds, for example), but I need to update only once.

To update every 5 seconds, I am using this code in my controller:

Response.AddHeader("Refresh", "5");

Is there any way to adapt to upgrade only once?

    
asked by anonymous 03.02.2015 / 22:52

1 answer

5

With an HTTP header I find it difficult, but you can use a script on your page:

window.onload = function() {
    if(!window.location.hash) {
        window.location = window.location + '#updateOnce';
        setTimeout(function () {
            window.location.reload();
        }, 5000);
    }
}
    
03.02.2015 / 23:17