I created a helper to build a list my problem it’s that each time that if expression it’s evaluate prints the value with true or false in my html. How can I avoid this behavior???
Here’s my helper
@helper elementTipificacion(IEnumerable<prueba.Models.Tipificacion> datos){
foreach (var item in @datos)
{
if (@item.Tipificacion1.Count > 0) <--- this the expression thay print's true or false
{
<li>
<a href="#" id="tipificacion-@item.IdTipificacion">@item.Nombre</a>
<ul>
@elementTipificacion(@item.Tipificacion1)
</ul>
</li>
}
else{
<li>
<a href="#" id="tipificacion-@item.IdTipificacion">@item.Nombre</a>
</li>
}
@datos.ToList().Remove(@item);
}
}
And this the output

You have too many
@. Use@only when you want to output a server side variable to the HTML. When you are inside a server side statement such as foreach, if, … don’t use @: