locked
Blazor server | functions happens twice RRS feed

  • Question

  • User2110873642 posted

    the following code results the console to output "tested" twice. the function runs 2 times. this is undesired behaviour for me.

    why does this happen? and how can i avoid it?

    @page "/Homepage"
    <h3>Homepage</h3>
    
    
    <div class="@test()"></div>
    
    @code {
        public string test()
        {
            Console.WriteLine("tested");
            return "";
        }
    }
    

    Thursday, July 30, 2020 11:02 PM

All replies