I am seeing OnAfterRenderAsync() get called before OnInitializedAsync() completes #51976
Unanswered
DavidThielen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is on .NET 8 (latest pre-release).
Is this possible? That
OnAfterRenderAsync()
will be called beforeOnInitializedAsync()
completes?If so, I then need to have my code in
OnAfterRenderAsync()
, in this case, be called at the end ofOnInitializedAsync()
instead. It's a piece of cake to have a method that is called from each and whoever is 2nd executes it.In this case is a counter inside a
lock { ... }
the best approach? Or should I take another approach?In _Host.cshtml I have:
In this mode OnInitializedAsync() is called once.
Beta Was this translation helpful? Give feedback.
All reactions