Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is causing __builder does not exist in current context error from compiler?

"Error CS0103 The name '__builder' does not exist in the current context"

Here is my code that causes the error:

@code {
    public void Calc()
    {
        for (int i = 0; i < 55; )
        {
           <div class="alert-info">

               <h3>This is the number" &nbsp;@i</h3>

           </div>
        }
    }
}

Error message from compiler


1 Answers

You can't render HTML in @code or @functions block. You can do this in a @{ } code bock.

like image 143
ltwlf Avatar answered Mar 06 '26 14:03

ltwlf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!