Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

I am seeing OnAfterRenderAsync() get called before OnInitializedAsync() completes

$
0
0

Is this possible? That OnAfterRenderAsync() will be called before OnInitializedAsync() completes?

If so, I then need to have my code in OnAfterRenderAsync(), in this case, be called at the end of OnInitializedAsync() 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:

<component type="typeof(HeadOutlet)" render-mode="Server" />

In this mode OnInitializedAsync() is called once.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>