Solved

VB ASP.NET: If Odd / Even

Posted on 2011-09-12
2
453 Views
Last Modified: 2012-05-12

I use this code determine if  ItemIndex is equal to 1:
<%# IIf ( Container.ItemIndex = 1, "Even", "Odd")%> 

Open in new window


How can I determine if ItemIndex is an odd number?
0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 400 total points
ID: 36523986
Try:
<%# IIf ( Container.ItemIndex Mod 2 <> 0, "Odd", "Even")%>

Open in new window

0
 
LVL 1

Assisted Solution

by:rerard
rerard earned 100 total points
ID: 36523997
Use mod, check this out:

http://msdn.microsoft.com/en-us/library/se0w9esz(v=vs.80).aspx

So if you do ItemIndex mod 2 it will return 0 for event, 1 for odd.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question