Am trying to add an ‘odd’ class to a table row in a repeater control..
<tr class="<%# If((Container.ItemIndex % 2 == 0), "even", "odd") %>">
I have verified that Container.ItemIndex returns the index number.
This causes it to throw this error..
First operand in a binary ‘If’ expression must be nullable or a reference type.
I also tried replacing the % with Mod keyword but it throws an “Expression expected” error..
Am new to coding asp.net in vb, tried searching for a solution but failed to get a working solution..
you should use only = instead of == and use mod