jdana
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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