Link to home
Start Free TrialLog in
Avatar of jdana
jdanaFlag for United States of America

asked on

Mysterioso ASP: <tr class="shade<%# Container.ItemIndex Mod 2 %>">

The ASP.NET shown in expression 1 produces the HTML shown in expression 2:

1) <tr class="shade<%# Container.ItemIndex Mod 2 %>">
2)       <tr class="shade0">...</tr>
          <tr class="shade1">...</tr>
          <tr class="shade0">...</tr>
          <tr class="shade1">...</tr>
          ...

I have to admit, the "Container.ItemIndex Mod 2" has me mystified.  

Is Container a namespace and ItemIndex a method?

I found numerous pages explaining how to use "Container.ItemIndex Mod 2", but none that explained what was going on.
ASKER CERTIFIED SOLUTION
Avatar of Snarf0001
Snarf0001
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdana

ASKER

Snarf0001,

Your explanation is one of the best explanations I've read over the last 3 years of using Experts Exchange.  It's well written, and, better yet, provides some terrific examples.  

Thanks.

J