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">
       
        <ItemTemplate>
          <table width="630"  border="0" cellpadding="0" cellspacing="0" class="formTABLE">
          <tr>
          <td>
            <asp:Label runat="server" ID="lblId" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem, "QuestionId") %>'></asp:Label>
          </td>
           <td  align="left">
            
            <asp:Label runat="server"  ID="lblQuestion" Text='<%# DataBinder.Eval(Container.DataItem, "Question") %>'></asp:Label>
           </td>
           <td  align="right">
            <label >
             <asp:RadioButton runat="server" ID="rbYes" CssClass="formFIELDsmall" TextAlign="Right" Text="Yes" GroupName="rbQuestionAnswer" />
            </label>
           
            <label>
              <asp:RadioButton runat="server" ID="rbNo" CssClass="formFIELDsmall" Text="No" TextAlign="Right" GroupName="rbQuestionAnswer" />
            </label>         
                   
            </td>
          </tr>
          </table>    
          
        </ItemTemplate>
      </asp:Repeater>

Open in new window

LVL 8
CamilliaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ApexCoCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
0
ApexCoCommented:
Ya, the radiobuttons can be a pain with CSS.

What I have found is the easiest thing...do not enter any text for the actual buttons. Just insert it with a regular  tag and style accordingly. It behaves much better that way.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.