2
Reply

How do you traverse through all radiobuttons on a form

ianparkins

ianparkins

Dec 4 2004 7:23 PM
2.3k
Hi All, I have a bunch of radio buttons on my webform. What I do is only allow one to be checked at a time. But now I want to be able to tell which one is the one that is checked. Is there a way to do something like: foreach (Radiobutton r in this.Controls) { if (r.Checked == true) { ..... } } Obviously the above code doesn't work, but is there a way to do something like that. I don't know the syntax to do it. Please help if you can. Thanks, Zach(Nevermore)

Answers (2)