Radio Box: RadioButtonRadioButton has a property groupname, when selected, the group name of each option must be set to the same View button is checked:BOOLSex =radiobutton1.checked; Label1.Text=sex. ToString (); radio button list: RadioButtonList properties: repeatdirection: Horizontally or vertically bound data: Textdatacontext context=NewTextdatacontext (); Radiobuttonlist1.datasource=context. Nation; Radiobuttonlist1.datatextfield="Name"; Radiobuttonlist1.datavaluefield="Code"; Radiobuttonlist1.databind (); Value of the selected item: Label1.Text=RadioButtonList1.SelectedValue.ToString (); Set which item is selected: Radiobuttonlist1.selectedindex=2; check box: checkbox to see if the button is selected: CheckBox1. Checked; The rest is the same as the box check box list: CheckBoxList property RepeatDirection: Horizontal or portrait vertical bound data: Checkboxlist1.datasource =context. Nation; Checkboxlist1.datatextfield="Name"; Checkboxlist1.datavaluefield="Code"; Checkboxlist1.databind (); Value of the selected item: Label1.Text="";//Clear foreach(ListItem Iteminchcheckboxlist1.items) {if(item. Selected) {Label1.Text+=item. Text; }} Set which item is selected: Single-checked: Checkboxlist1.selectedindex=2; Multiple-item selection:foreach(ListItem Iteminchcheckboxlist1.items) {if(item. Text = ="Han"|| Item. Text = ="Manchu") {Item. Selected=true; }} Example: If the code is not executed, it is likely that AutoPostBack is not set to Ture
20151220 What to learn: web radio box, check box