Validating radiobuttons in a Repeater

I've been reading that validation for radiobuttonlist are easier than for radiobuttons. But i have a radiobutton in a repeater. It's a yes/no radiobutton. I bind questions from database to this repeater...

User can't leave any question empty. Either Yes or No should be clicked. How can validate this?

For other fields on my page, I have RequiredFieldValidator. I display the error msgs on the screen,using a ValidationSummary. But not sure how to do it for radiobuttons in Repeater
<asp:Repeater runat="server" ID="rpQuestions">
          <table width="630"  border="0" cellpadding="0" cellspacing="0" class="formTABLE">
            <asp:Label runat="server" ID="lblId" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem, "QuestionId") %>'></asp:Label>
           <td  align="left">
            <asp:Label runat="server"  ID="lblQuestion" Text='<%# DataBinder.Eval(Container.DataItem, "Question") %>'></asp:Label>
           <td  align="right">
            <label >
             <asp:RadioButton runat="server" ID="rbYes" CssClass="formFIELDsmall" TextAlign="Right" Text="Yes" GroupName="rbQuestionAnswer" />
              <asp:RadioButton runat="server" ID="rbNo" CssClass="formFIELDsmall" Text="No" TextAlign="Right" GroupName="rbQuestionAnswer" />

Open in new window

Who is Participating?
ApexCoConnect With a Mentor Commented:
You could just change those two radio buttons to a radiobuttonlist inside the repeater. Give it your 2 values of yes/no and refactor your code accordingly.
CamilliaAuthor Commented:
Let me try that. I think i used the radiobutton because of the CSS positioning/ look-and-feel of that section. But let me try.
Ya, the radiobuttons can be a pain with CSS.

What I have found is the easiest not enter any text for the actual buttons. Just insert it with a regular  tag and style accordingly. It behaves much better that way.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.