title: How to get values from HTML radio buttons inside a repeater?
body: <p>I have a simple questionnaire system which shows a random number of questions to the user out of a certain total in my database.</p>
  
  <p>I have 2 separate tables: <code>Questions</code> and <code>Alternatives</code> (which are the options to answer) related by <code>QuestionID</code> field in both tables. I rendered such questionnaire using <strong>Nested Repeaters</strong> (<em>parentRepeater</em> for questions and <em>childRepeater</em> for the options) and it shows correctly on the page.</p>
  
  <p>Each option is a radio button which I had to use it as a HTML instead of the <em>Standard Server Control</em> <code>&lt;asp:RadioButton&gt;</code> because of the Dynamic ID problem inside a repeater.</p>
  
  <p>So my <code>.aspx</code> code is like this:</p>
  
  <pre><code>&lt;asp:Repeater ID="rptQuestoes" runat="server"&gt;
                      &lt;HeaderTemplate&gt;
                          &lt;form method="get"&gt;
                          &lt;ol class="orderedList"&gt;
                      &lt;/HeaderTemplate&gt;
  
                      &lt;ItemTemplate&gt;
                          &lt;li&gt;
                              &lt;%#DataBinder.Eval(Container.DataItem, "QuestionName")%&gt;
                              &lt;asp:Repeater ID="rptAlternativas" DataSource='&lt;%# Container.DataItem.Row.GetChildRows("Questionario") %&gt;' runat="server"&gt;
                                  &lt;HeaderTemplate&gt;
                                      &lt;ul style="list-style-type: none"&gt;
                                  &lt;/HeaderTemplate&gt;
  
                                  &lt;ItemTemplate&gt;
                                      &lt;li&gt;
                                          &lt;input id="&lt;%#Container.DataItem("AlternativeID")%&gt;" type="radio" runat="server" name="&lt;%#Container.DataItem("QuestionID")%&gt;" value="&lt;%#Container.DataItem("AlternativeID")%&gt;" /&gt;&lt;%#Container.DataItem("AlternativeName")%&gt;
                                      &lt;/li&gt;
                                  &lt;/ItemTemplate&gt;
  
                                  &lt;FooterTemplate&gt;
                                      &lt;/ul&gt;
                                  &lt;/FooterTemplate&gt;
                              &lt;/asp:Repeater&gt;
                          &lt;/li&gt;
                      &lt;/ItemTemplate&gt;
  
                      &lt;FooterTemplate&gt;
                          &lt;/ol&gt;
                          &lt;/form&gt;
                      &lt;/FooterTemplate&gt;
                  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>What I don't know is how do I get all the questions answered by the user given that I don't know the <code>QuestionID</code>s and the <code>AlternativeID</code>s since it's randomly generated and using a HTML <code>input</code> tags?</p>