The RadioButton control Web Controls

260 Dim oList As ListItem For Each oList In oListBox.Items If oList.Selected Then Do something End If Next

6.3.1.7 The RadioButton control

The RadioButton control corresponds to a single button in a group of buttons used to indicate mutually exclusive choices. It has the following HTML syntax: asp:RadioButton id=RadioButtonName AutoPostBack=True|False Checked=True|False GroupName=GroupName Text=label TextAlign=Right|Left OnCheckedChanged=OnCheckedChangedMethod runat=server As in the CheckBox control, the Checked attribute determines whether the control is checked. Only one control in the group designated by GroupName can be set to True . The default value of the Checked attribute is False . However, since it is possible for the Checked attributes of all radio buttons in a group to be False , it is important to initially set the Checked attribute of one member of the group to True . The GroupName attribute provides a common name by which all radio buttons in the group can be identified. The Text attribute defines the caption that appears either to the left the default or to the right of the radio button, depending on the setting of the TextAlign attribute. Each of these attributes of the RadioButton control directly corresponds to an identically named property of the System.Web.UI.WebControls.RadioButton class. The value of the TextAlign property is either of the two members of the TextAlign enumeration: TextAlign.Left , which positions the text to the left of the checkbox the default; and TextAlign.Right , which positions the text to the right of the checkbox. The Checked property is a Boolean that can be programmatically set and can also change as a result of user interaction. Note that the user changing the Checked property of another radio button in the group from False to True automatically changes the value of the Checked property of any checked radio button from True to False . Finally, the OnCheckedChanged attribute defines an event handler that will be executed whenever the Checked property of the radio button is changed. The event handler designated by the OnCheckedChanged attribute must have the following signature: Sub OnCheckedChangedMethodsender As Object, e As EventArgs

6.3.1.8 The Table control