How to check which radio button is checked in data list?
<p>I am trying to get which radio button is checked in the data list and that radio button value using javascript or c#.</p>

<p>i have code:</p>

<pre><code>&lt;asp:DataList ID="DataList1" runat="server" 
        BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        DataKeyField="Qno" DataSourceID="SqlDataSource1"&gt;
        &lt;EditItemStyle HorizontalAlign="Left" /&gt;
        &lt;FooterStyle BackColor="#FFFFCC" ForeColor="#330099" /&gt;
        &lt;HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" /&gt;
        &lt;ItemStyle BackColor="White" ForeColor="#330099" /&gt;
        &lt;ItemTemplate&gt;
            Qno:
            &lt;asp:Label ID="QnoLabel" runat="server" Text='&lt;%# Eval("Qno") %&gt;' /&gt;
            &lt;br /&gt;
            Question:
            &lt;asp:Label ID="QuestionLabel" runat="server" Text='&lt;%# Eval("Question") %&gt;' /&gt;
            &lt;br /&gt;
            Ans1:
            &lt;asp:RadioButton ID="RadioButton1" GroupName="gp" Text='&lt;%# Eval("Ans1") %&gt;' runat="server" /&gt;
            &lt;br /&gt;
            Ans2:
            &lt;asp:RadioButton ID="RadioButton2" GroupName="gp" runat="server" Text='&lt;%# Eval("Ans2") %&gt;' /&gt;
            &lt;br /&gt;
            Ans3:
            &lt;asp:RadioButton ID="RadioButton3" GroupName="gp" runat="server" Text='&lt;%# Eval("Ans3") %&gt;' /&gt;
            &lt;br /&gt;
            Ans4:
            &lt;asp:RadioButton ID="RadioButton4" GroupName="gp" runat="server" Text='&lt;%# Eval("Ans4") %&gt;' /&gt;
            &lt;br /&gt;
            &lt;br /&gt;
        &lt;/ItemTemplate&gt;
        &lt;SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" /&gt;
        &lt;SeparatorStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right" /&gt;
    &lt;/asp:DataList&gt;
</code></pre>
