0

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 Answer 1

1
for (int i = 1; i < collection.Count; i += 2)
{ 
    var value = collection[i.ToString()];
    // do whatever with value
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.