❔ Blazor: Page loads only one time
Hello, I have an account list, each time I press on an account it loads a specific page (account overview). I set the currently selected Account in a Service, so that I can Initialize the Overview in the Overview page for that specific account. However "OnInitializedAsync" does not get triggered each time I navigate to the page, but only once. So that it works for the first account, but not for the second since it does not update. It needs to initialize some values for that specific account before it can render it.
5 Replies
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/you can use onparametersetasync if your AccountId or whatever you're using to get the new account is a parameter. could set it in the page directory like so when you navigate to the other account
@ page Account/{AccountId: int?}/
but yeah some additional context would be nice
Could work too. I have fixed it now by loading the data before I load the page like this:
not sure if its optimal but works
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.