Solved

VB ASP.NET: If Odd / Even

Posted on 2011-09-12
2
446 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
2 Comments
 
LVL 74

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now