Click here to Skip to main content
15,938,281 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Data not loading on page refresh in blazor webassembly standalone app

What I have tried:

I have created a sample web app in blazor as webassembly standalone app,
then I simply published this web app in a local folder and hosted it in the iis as a website,
then I browse the site it worked properly but I refreshed the page then got the error page. I looked for the issue on internet then I found one setting to be done in the web.config file of the application. I did the same and error page did not come but the data was also not loaded which I am fetching from the sql server. Currently the sql server is in the same machine but I want the solution for both 1. sql server in local machine 2. sql server on a hosted server. Also the menus given in the left hand side got hidden and I was unable to expand them using the menu button just like app got hannged. On browsers back button I went back then app started working but the page refresh issue still persists.
Posted
Comments
Graeme_Grant 20-Apr-24 8:05am    
What error? Did you open the browser web tools > console window, reload the page and inspect the error message? What was the exact error? Hit the Improve link above and post the complete error message.

1 solution

Like desktop apps, you should use multiple techniques to capture and handle errors in your app. Blazor is no different. This page lists a number of strategies that you should be using: Handle errors in ASP.NET Core Blazor apps | Microsoft Learn[^].

Once you have the error information with call stack, you have the information needed to identify what is happening inside your app to track down and fix the issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900