when a radio button is posted, like all form elements, it sends its name & value. normal html form convention is that you woudl give the radio button the same names (to make then mutually exclusive) and give then unique values, so the server can determine
which one was checked. if you folowed this convention, then in mvc for the parameter (or model property) gender, the value would be the value of the checked radio button. just add value attributes to your radio buttons.
note: in you case as you don't supply a value, there is none posted back.
bruce (sqlwo...
All-Star
36822 Points
5441 Posts
Re: Binding radio button selection to entity
Apr 29, 2012 08:52 PM|LINK
when a radio button is posted, like all form elements, it sends its name & value. normal html form convention is that you woudl give the radio button the same names (to make then mutually exclusive) and give then unique values, so the server can determine which one was checked. if you folowed this convention, then in mvc for the parameter (or model property) gender, the value would be the value of the checked radio button. just add value attributes to your radio buttons.
note: in you case as you don't supply a value, there is none posted back.