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:
">Copy@inject NavigationManager NavigationManager
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.