[thelist] (ASP.NET): Grouping radio buttons in a repeater.

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Thu Feb 16 12:32:22 CST 2006


   If you plan to use a group, or anything with runat="server", your only option will be to go through and change the names client-side (myTable.getElementsByTagName should get you started in the right direction).  Of course this could mess things up in Viewstate when you post back, which at best would have you using Request.Form to retrieve the value... and at worst would throw a yellow barf screen error.

FWIW...

Peter

 From: "Tab Alleman" talleman at Lumpsum.com

I have a repeater that creates one radio button for every item. I want these radio buttons grouped together so that only one of them can be selected.

In my repeater, I specify this:

rbPhonePrimary.GroupName = "rbgPhonePrimary"

but when it produces the page, the radio buttons get names like this:

name="rptPhone:_ctl0:rbgPhonePrimary"
name="rptPhone:_ctl1:rbgPhonePrimary"
name="rptPhone:_ctl2:rbgPhonePrimary"
etc...

Is there any way to get what I want here?




More information about the thelist mailing list