473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to get each rows radio button value from data list?

I want to put some questions with a data list view with multiple choice radio button so how to get each question answer or checked radio button value from list?
i have this asp code:
Expand|Select|Wrap|Line Numbers
  1. <asp:DataList ID="DataList1" runat="server" BackColor="White"
  2.             BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
  3.             DataKeyField="Qno" DataSourceID="SqlDataSource1" GridLines="Horizontal" 
  4.             HorizontalAlign="Center" Font-Bold="False" Font-Italic="False" 
  5.             Font-Overline="False" Font-Size="Larger" Font-Strikeout="False" 
  6.             Font-Underline="False">
  7.             <EditItemStyle HorizontalAlign="Left" />
  8.             <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
  9.             <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
  10.             <ItemStyle BackColor="White" ForeColor="#330099" />
  11.             <ItemTemplate>
  12.                 Qno:
  13.                 <asp:Label ID="QnoLabel" runat="server" Text='<%# Eval("Qno") %>' />
  14.                 <br />
  15.                 Question:
  16.                 <asp:Label ID="QuestionLabel" runat="server" Text='<%# Eval("Question") %>' />
  17.                 <br />
  18.                 Ans1:
  19.                 <asp:RadioButton ID="RadioButton1" GroupName="gp" Text='<%# Eval("Ans1") %>' runat="server" />
  20.                 <br />
  21.                 Ans2:
  22.                 <asp:RadioButton ID="RadioButton2" GroupName="gp" runat="server" Text='<%# Eval("Ans2") %>' />
  23.                 <br />
  24.                 Ans3:
  25.                 <asp:RadioButton ID="RadioButton3" GroupName="gp" runat="server" Text='<%# Eval("Ans3") %>' />
  26.                 <br />
  27.                 Ans4:
  28.                 <asp:RadioButton ID="RadioButton4" GroupName="gp" runat="server" Text='<%# Eval("Ans4") %>' />
  29.                 <br />
  30.                 Answer:
  31.                 <asp:Label ID="AnswerLabel" runat="server" Text='<%# Eval("Answer") %>' />
  32.                 <br />
  33.                 <br />
  34.             </ItemTemplate>
  35.             <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
  36.             <SeparatorStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
  37.                 Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right" />
  38.         </asp:DataList>
Any help will be highly appreciated.
Mar 30 '12 #1
0 2184

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mokoena | last post by:
I can't seem to do an if statement check on the value returned from a selected radio button (isexistingleague). The code never runs anything within the if statement that tests if "true" is...
3
by: Flip | last post by:
In setting up a radio button group last night, I added two radio buttons, gave each of them their respective name and gave them both the same group name. So far so good. But then when I tried to...
1
by: Shahid Saleem | last post by:
Dear Members I am using a data list , in the item template i have used a data grid with template column (CheckBox) and a button named sumbit. I want to get the data grid selected rows(Makred...
4
by: yawnmoth | last post by:
I'm trying to display a popup showing which radio button is selected and am unable to do so. Every time I try, I get undefined, instead of the value of the particular form variable I'm trying to...
2
by: Matsam | last post by:
Hi, I have an ASP page that contains 3 radio buttons and a combo box. The combo box is to be populated depending on the option selected above. I am using Access DB. I want the value/checked...
4
by: Sonasang | last post by:
Hi , I am creating webpage in ASP. In that page i am using 2 radio button..... Male and female If onclick event fires for the radiobutton i have to update the value in the database as male (if...
1
by: selvialagar | last post by:
my code doesn't work. undefined is displayed.....how to get a value of radoi button in javascript function enableaddr() { alert(document.getElementById('reason').length); for (var i=0; i <...
5
Claus Mygind
by: Claus Mygind | last post by:
In my script I used to test the value of the radio button to verify which button was selected. I was able to do that because all the buttons have the same name. If I want to use the the proper...
9
by: ameshkin | last post by:
Hi guys, I'm a pretty good PHP programmer, but when it comes to JS, I just dont understand it! But I really need to learn. I'm having trouble doing the simplest thing! When someone clicks...
1
by: lipton | last post by:
how can i compare a mysql table feild value with selected redio button value with php
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.