I got this code:
@foreach (var team in Model.GetTeams)
{
var i = 0;
foreach (var employee in team.Medewerkers)
{
if (i == 0)
{
@:<li class="flip-card">
@:<div class="flip-card-back">
@:</div>
i=1;
}
else
{
@:<div class="flip-card-front">
@:</div>
@:</li>
i = 0;
}
}
if (i == 1)
{
</li>
}
}
Now it's possible that there are 3 employees in a team so the li tag would never close. So I thought I would add an if statement at the end to check if i == 1 so I can close the li tag but when I use this code, Razor complains that I close a tag which is never started.
How can I achieve this goal?
<li>containing a<div>for each employee or one<li>for each employee? - user3559349