I have a blazor webapp ( I am still learning and I cannot find an answer to this with any AI bots or google).
I am using .net 8.0.406 version
My issue is that lets say I am in homepage (http://localhost:5022) and if I have a button that takes me to the page http://localhost:5022/newpage
We all know that blazor webapp only fetch the data that is needed to show the page. So if I have a navbar (that is put into the common layout), that will not be loaded.
Now the issue is that when I click on the button, under "Network" in DevTools, I can see that it just sent a GET request to receive the page and the next element in "Network" is the razor page that was asked by the GET request.The razor page received has the code
<script src="js/mycode.js"></script>but the script never gets sent to the client so whatever is in the script never gets execute.However, if I just reload, the file mycode.js gets sent to the client for executing the page http://localhost:5022/newpage