Question

Why RadioButton/CheckboxButton don't have a VALUE attribute ?

The HTML input radio have a VALUE attribute, why the RadioButton/CheckboxButton don't? That's a real error Microsoft! Why that?

Now, imagine a situation:

You need a list of cars from Database, the user need to choose only one, you put a list of radioButton with TEXT attribute with the name of the car AND the correct is to save the ID of register from Database in a VALUE attribute. The user will choose one register and i will get the value of that input and save in database.

But with Microsoft RadioButton that's is not possible by default, I'll should get the name of the car in TEXT attribute, find a register by the name of the car ( WHERE name = 'volvo' //THATS WRONG ) and get the ID of the register and then save to database.

Another way is verify if the radioButton is checked and put Manually ID of register to save in database if radioButton2 is checked.

THAT'S DEFINELY WRONG.

Was it helpful?

Solution

check out the RadioButtonList control which has properties for DataTextField and DataValueField

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top