I'm trying to apply some odd/even style to rows of data rendered by a Razor editor template in ASP.NET MVC 3.
Here is some basic code of my possible view:
@model List<MyProject.Whatever>
@Html.EditorFor(Model)
And here the possible editor template:
@model MyProject.Whatever
<div class="@( AnIInAnEvenOrOddRow ? "even" : "odd" )">
@Model.SomeData @Html.TextBoxFor(m => m.SomeTextToType)
</div>
Have anybody an idea how I can detect the even/odd situation from inside the editor template?
Cheers...