Blazor

How do I reconnect Blazor server-side automatically?

 How do I reconnect Blazor server-side automatically?

To reconnect the Blazor server automatically you need to include the following code in the script of the Blazor application. This will refresh the Blazor server automatically when it is up again.

[_Host.cshtml]

<script>
   Blazor.defaultReconnectionHandler._reconnectCallback = function(d) {
        document.location.reload(); 
   }
</script>

for better understanding you can check the below-given link:

https://stackoverflow.com/questions/59779601/auto-reconnect-blazor-serverside

Sumitra Kumari Shaw

An Engineering graduate who Enjoys building things that live on the internet.