Live Chat Icon For mobile
Live Chat Icon

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>

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

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.