Solved

VB ASP.NET: If Odd / Even

Posted on 2011-09-12
2
449 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 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Regex validation 2 24
Error handling in asp.net site 5 27
VB.NET 2008 Publish Error 2 27
asp.net input html code have it display the content 2 12
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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

772 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