Show hello many times

You can use dotnet watch and observe the result of code changes instantly on the browser!

Cannot do this

//Wrong
<div>
    @for(int i=1; i<=10; i++) 
        <span>hello</span>
</div>

Correct way

@page

<div>
    @for(int i=1; i<=10; i++){
        <span>hello</span>
    }         
</div>

Or this, without the div tag and using para tag

@page

@for (int i = 1; i <= 10; i++)
{
    <p>hello</p>
}

Last updated