Monday, August 16, 2010

I need help with validating a radio button list where I restrict values in asp.net c# code?

I have a radio button list for contract where the user clicks Yes or No. I need to add a validator to this where I restrict the values to 1 and 0. I am not sure how to do this, can someone please help.I need help with validating a radio button list where I restrict values in asp.net c# code?
I believe you can use the event CheckedChanged to call a function. When that happens, you can set the value to a variable and check which button is checked. Assuming you have radiuButton1 as one of the ID of the radio button, then you could use radioButton1.Checked to check which one is checked. Also make sure that both buttons are on the same group.

No comments:

Post a Comment