abhisheknayak9 0 Newbie Poster

i want to check which radio button is checked in rows of a datalist and compare that radio button value with database feild value using javascript or c# can anyone suggest me idea.
i has this code:

Code blocks are created by indenting at least 4 spaces
... and can span multiple lines

<asp:DataList ID="DataList1" runat="server" BackColor="White"
BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4"
DataKeyField="Qno" DataSourceID="SqlDataSource1" GridLines="Horizontal"
HorizontalAlign="Center" Font-Bold="False" Font-Italic="False"
Font-Overline="False" Font-Size="Larger" Font-Strikeout="False"
Font-Underline="False">
<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 />
Answer:
<asp:Label ID="AnswerLabel" runat="server" Text='<%# Eval("Answer") %>' />
<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>
<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="checkRadio()" >CHECK</asp:LinkButton>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.