Hi Sck10,
Thank you for posting in the ASP.NET newsgroup.
From your description, I understand you're building an ASP.NET web page
which contains many radio buttons and these radio buttons are associated to
many "survey questions"(four buttons per question. Currently you're
wondering how to programmatically loop through all those radio buttons on
the page and save their status information into backend database, correct?
Based on my experience, you can consider using template databound control
to display those radio buttons (grouped by survey questions). This is
because template databound control support displaying list of control
region through databinding. Therefore, in your case, you can put four radio
buttons in the template databound control's Template and bind it with a
datasource which contains the survey question list. e.g.
=========================
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<br /><asp:Label ID="lblQuestion" runat="server" Text='<%#
Eval("Question") %>'></asp:Label><br />
<asp:RadioButton ID="a1" Text="Answer 1" runat="server" />
<asp:RadioButton ID="a2" Text="Answer 2" runat="server" />
<asp:RadioButton ID="a3" Text="Answer 3" runat="server" />
<asp:RadioButton ID="a4" Text="Answer 4" runat="server" />
<br /><hr />
</ItemTemplate>
</asp:Repeater>
=============================
The above repeater control uses the "ItemTemplate" to define the control
region for each survey question. You can simply generate a datasource
containing all the questions and bind it to the repeater at runtime. Also,
if you need further customization on the repeater or each repeater item,
you can use the "ItemDataBound" event.
In addition, if you don't want to use databinding based solution, you can
also consider using the table control (html table or asp.net table control)
to display the radiobuttons and each table row contains the radio buttons
associated with a certain question.
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)