title: How to take RadioButtonList.SelectedIndex in to an array of Ints?
body: <p>I simply wants to Take SelectedIndex of radiobuttonlist into an int array on OnSelectedIndexChanged event. I tried following code but won't worked:</p>
  
  <p>i make an array like this:</p>
  
  <pre><code>int[] correctAnswers = { -1, -1, -1, -1, -1 }; and i tried this as well:     
  int[] correctAnswers = new int[100];
  
  //SelectionChangeEvent    
  protected void rbAnswers_SelectedIndexChanged(object sender, EventArgs e)    
  {               
      int j = rbAnswers.SelectedIndex;                
      correctAnswers.SetValue(j, i); //or correctAnswers[i] = j;        
  }
  </code></pre>
  
  <p>I'm making a online test system in .Net. I'm changing question in label and answers in RadioButtonList. Values are coming from database. and I'm changing RadioButtonList dynamically but if i select one answer and click on next button and then go back by pressing previous button my selection disappear. so for that i have a logic that is to store selected index in an int array and on next and previous button call that index value and put into in SelectedIndex struck of RadioButtonList. so please help me out that how can i take this selected value in an int array on OnSelectionChange? and one more addition is that i make Post Back True of RadioButtonList.</p>