Hi all,
Is there a way in something like a DataList, to have a different colour
background (via CssClass) without repeating all my code in both the
ItemTemplate and AlternatingItemTemplate blocks?
I have quite a lot of stuff in the ItemTemplate block, but because so much
of it is bound fields, creating a seperate user control mapping all of these
fields across would be a nightmare to maintain. Instead, I'd like something
like:
<ItemTemplate>
<div class="<% SomeExpress that returns True/False or Odd/Even etc. %>">
// all my stuff here
</div>
</ItemTemplate>
If there was a sort of "row number" I could get at, I could do "(row) Mod 2"
to do what I want, but I can't see anything obvious to do that.
Any ideas?
Thanks,
Danny Tuppeny