views:

45

answers:

1

Hello friends,

I need to Loop my FormCollection to get Id values from collection..

I have something like

collection[0]
collection[1]
collection[2]
collection[3]
collection[4]
collection[5]
collectoin[6]

I have 7 or more keys I need to get second Index that means 1 3 5 7 9 11. something likethat.. I need to loop to get those values..

Can any body help me out.. using asp.net mvc..

thanks

+1  A: 
for (int i = 1; i < collection.Count; i += 2)
{ 
    var value = collection[i.ToString()];
    // do whatever with value
}
Scott Lance