A page is reloaded/refreshed automatically at a specified interval using “NavigationManager” in OnAfterRender() method. Here the NavigateTo(“url”, forceLoad: true) method, is used to force load the browser based on the URI.
@inject NavigationManager uriHelper;
@usingSystem.Threading;<h1>Hello, world!</h1>
Welcome to your newapp.
@code{protectedoverridevoidOnAfterRender(bool firstRender){if(firstRender){var timer =newTimer(newTimerCallback(_ =>{
uriHelper.NavigateTo(uriHelper.Uri,forceLoad:true);}),null,2000,2000);}}}
A page is reloaded/refreshed automatically at a specified interval using “NavigationManager” in OnAfterRender() method. Here the NavigateTo(“url”, forceLoad: true) method, is used to force load the browser based on the URI.