Accessing dynamic radio buttons

U

UJ

I have a placeholder where I dynamically add radio buttons based on values
from a DB. It's all one group. How can I access them so that I know which
one is selected?

I've tried both input type="radio" and asp:radiobutton

I can't seem to add a checked.changed event to the radiobutton and when I
search through the assorted controls on the page, I can't find the control
anywhere (through code.)

TIA - Jeffrey.
 
U

UJ

Brock,
Thanks I think. But that doesn't really answer my question. I have the
creation of the radiobuttons working fine. The problem is - I need to know
which radio button is selected.

Any suggestions?

TIA.
 
B

Brock Allen

When you dynamically create them handle the SelectedindexChanged event. The
first paramater is the sender of the event, which will be your RadioButtonList.
Or am I still missing what you're trying to do?
 
U

UJ

I'm not using a radiobuttonlist - I have a series of radio buttons. The
reason for the individual radio buttons is that I need more layout control
than what a radiobuttonlist will give me.
 
B

Brock Allen

So you can handle the OnCheckChanged event for the RadioButton, and in the
event handler the first parameter is the sender which is the RadioButton
that was checked. I hope this helps?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top