Blazor Timer call async API task to update UI

You probably don’t want to Invoke() the GetValue(), that would be rather pointless. You can implement the timer like this: System.Threading.Timer timer; protected override void OnInitialized() { timer = new System.Threading.Timer(async _ => // async void { Time = await GetValue(); // we need StateHasChanged() because this is an async void handler // we need … Read more

How to use the HttpContext object in server-side Blazor to retrieve information about the user, user agent

The fiction that the HttpContext object can’t be used with Blazor Server App, has been long propagated on Stackoverflow, and it is high time to pension it off. It is true that the HttpContext is not available when a WebSocket connection is in operation, but this must be clear: When you type an url and … Read more