Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I would like to assign a css class to a div depending on if it is an even or odd child. This is what I have:
@foreach (var item in DynamicModel.Children) { <div class="@item.Position().IsEven("even_class","odd_class")> stuff </div> }
I'm very new to Razor, so I guess the expression is wrong because I get this error:
Could not finding matching Signature for 'Position' with 0 parameters.
Any ideas?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 5: Assign class to even/odd children
I would like to assign a css class to a div depending on if it is an even or odd child. This is what I have:
@foreach (var item in DynamicModel.Children)
{
<div class="@item.Position().IsEven("even_class","odd_class")>
stuff
</div>
}
I'm very new to Razor, so I guess the expression is wrong because I get this error:
Could not finding matching Signature for 'Position' with 0 parameters.
Any ideas?
is working on a reply...