Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Razor break/continue in loop

<ul>  
    @for (int i = 0; i < names.Count; i++)  
    {  
        <li>@names[i]</li>  
        @if(i >= 2)  
        {  
            <li>...and so on</li>  
            break;  
        }  
    }  
</ul>
Source by asp.mvc-tutorial.com #
 
PREVIOUS NEXT
Tagged: #Razor #loop
ADD COMMENT
Topic
Name
5+3 =