I'm having a difficult time getting the below code to work. It's choking on the testArray[Count] = "asdf" statement. How should this statement be written?

<ul class="product-options--list">
   @foreach (var fields in Component.Fields.product_links)
      testArray[Count] = "asdf";                    
  • What are "testArray" and "count"? please explain a little about your problem and what is the error? – Saurabh Gangwar Jan 15 '15 at 19:15
  • 5
    I'm flagging this question for closure as off-topic because it's not really about Tridion. It's just a bug in the questioner's code, and he's found the answer. I don't think any Tridion people are going to profit by it remaining in the site. – Dominic Cronin Jan 20 '15 at 10:37

My declaration of the array was incorrect.

  • 5
    That's not an answer that someone else can use. Could you please explain how you were declaring it wrong (ideally by including it in the question) and how to do it right (in the answer)? – Peter Kjaer Jan 16 '15 at 6:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.