You need a counter in the repeater. There is one:
<%# Container.ItemIndex + 1 %>
<%# Container.DisplayIndex+1 %>
(the +1 is because it starts counting at 0, and you want to start counting at 1)
Then you need a function to see if the number is divisible by 4. That can be done using the MOD (VB) operator, or whatever it is in C#. Ah, in C# it is the % operator.
And you need an conditional function, IIF() in VB. Find it yourself in C#.
<asp:repeater>
<ItemTemplate>
<div class="<%#IIF((Container.It
</div>
</ItemTemplate>
</asp:repeater>
Main Topics
Browse All Topics





by: dhansmaniPosted on 2009-11-03 at 03:33:27ID: 25727858
instead u reapter control use DataList. If u r using Datalist, its possible to change css dynamically.