OnAfterRenderAsync always execute twice

Posted 3 years ago by leowidodo
0

Why this code always execute twice?

Any one can help ? I already use .Net 5 version. Is there any update of this problem?

protected override async Task OnAfterRenderAsync(bool firstRender)

   {       

Console.WriteLine("\n\n\nHello There");

   }

 

Thanks

  • 0

    You still need to make sure it's the first render.

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
    	if(firstRender)
    		Console.WriteLine("\n\n\nHello There");
    }
    Posted 3 years ago by selliott Edited 3 years ago
Someone is typing...

Post a Reply

You must be logged in to add a new post.
Number of online users: 0
An error has occurred. This application may no longer respond until reloaded. Reload 🗙