Search code examples
c#asp.netradio-buttondatalist

One selectable RadioButton inside DataList


I am trying to implement multiple choice questions within my web application. I have datalist within a datalist. First datalist contains questions, second datalist contains choice, only one choice should be selectable at a time. I am using radio button. Even though I have set RadioButton.GroupName property, I can't make them selectable one at a time.

Please help.


Solution

  • Use a RadioButtonList, only one RadioButton of a RadioButtonList can be selected. Use the RadioButtonList instead of the second DataList.