Mark Tabor

Mark Tabor

  • 548
  • 2k
  • 460.3k

How to refresh a view without flickering effect on all brows

Dec 15 2019 2:38 AM
Hi I have a requirement that i need to refresh a MVC view after every 2 seconds , so what approach can i use i have done it using javascript function it works well , but on IE and firefox it gives flickering problem, My view does not contain only the static data instead it is calling a controller method which shows the count of users after every two seconds . below is the approach i am using 
<script type="text/javascript">
function timedRefresh(timeoutPeriod) {
setTimeout(function () {
location.reload(true);
}, timeoutPeriod);
}
</script>
 ---------------
<meta http-equiv="refresh" content="2" /> 

Answers (2)