我想獲得哪些單選按鈕被選中的數據列表和單選按鈕值使用javascript或c#。如何檢查數據列表中選中哪個單選按鈕?
我有代碼:
<asp:DataList ID="DataList1" runat="server"
BorderStyle="None" BorderWidth="1px" CellPadding="4"
DataKeyField="Qno" DataSourceID="SqlDataSource1">
<EditItemStyle HorizontalAlign="Left" />
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
<ItemStyle BackColor="White" ForeColor="#330099" />
<ItemTemplate>
Qno:
<asp:Label ID="QnoLabel" runat="server" Text='<%# Eval("Qno") %>' />
<br />
Question:
<asp:Label ID="QuestionLabel" runat="server" Text='<%# Eval("Question") %>' />
<br />
Ans1:
<asp:RadioButton ID="RadioButton1" GroupName="gp" Text='<%# Eval("Ans1") %>' runat="server" />
<br />
Ans2:
<asp:RadioButton ID="RadioButton2" GroupName="gp" runat="server" Text='<%# Eval("Ans2") %>' />
<br />
Ans3:
<asp:RadioButton ID="RadioButton3" GroupName="gp" runat="server" Text='<%# Eval("Ans3") %>' />
<br />
Ans4:
<asp:RadioButton ID="RadioButton4" GroupName="gp" runat="server" Text='<%# Eval("Ans4") %>' />
<br />
<br />
</ItemTemplate>
<SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<SeparatorStyle Font-Bold="True" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right" />
</asp:DataList>
如何從數據列表中獲取一行單選按鈕值假設示例我希望從第2行或第3行中選中的單選按鈕的值如此? – Abhishek 2012-03-28 07:18:14