Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Can I "soft reload" a Blazor page component without a full browser reload?

$
0
0

I'd like to reload a Blazor page component without triggering a full browser reload.Using NavigationManager to reload works, but I'm looking for a softer approach:

  • The page itself stays loaded, so singleton services keep their state.
  • The component (for example, one with @page "/entity/{id:int}/edit") should call IDisposable.Dispose if implemented.
  • A new instance of that component is created, so OnInitializedAsync runs again and all markup is rebuilt.

I think a workaround is to navigate to a "middle" page like /soft-reload?returnUrl=... and redirect back, but I wonder if there's a better way? Also, would the same technique work for non-page components?

Ideally, without involving JavaScript.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>