You can refresh a Blazor page from onclick by using the NavigationManager class.

You can use the NavigateTo method of the NavigationManager class to navigate to the current page with the forceLoad parameter set to true.

This will force the browser to reload the page from the server and refresh the UI. Here’s an example:

@inject NavigationManager NavigationManager


">Copy

This will refresh the current page when you click on the button. You can also use this method to navigate to a different page and refresh it.

Author: Chester Bryndza

  • Author image
    Published: Friday, May 26, 2023
    Scope: Public
    Tag: BLAZOR