RadioButtonList and SelectedItem when control is disabled

A

Amil

I have a RadioButtonList that can be disabled on the form via a higher up
checkbox. Even if the checkbox disables the radio buttons, I do want to
save to a DB the currently selected radio button...so I can restore the
user's last choice.

Seems like if the RadioButtonList is disabled (via client Javascript), then
the code-behind always returns -1 for the SelectedIndex property.

Is there a way to figure out what is selected (e.g. checked) even if it is
disabled?

Amil
 
A

Amil

I ended up adding a hidden field and setting it to the index of the radio
button via client js. I used "runat=server" so I could declare it via C#
and read it in code-behind. Works, but seems like I should have been able
to get it via the radiobuttonlist :-(

Amil
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top