Is it possible to load a server side Blazor pages HTML before the code is executed?
Issac pointed to the solution in their comment:
Try to use OnAfterRenderAsync instead
I just write the code:
@code
{
protected bool Rendered = false;
protected async override Task OnAfterRenderAsync()
{
if (!Rendered)
{
Rendered = true;
await OnAfterFirstRenderAsync();
}
}
protected async Task OnAfterFirstRenderAsync()
{
data = await TaskService.GetDataAsync();
}
}