MutuallyExclusiveCheckBox Demonstration
MutuallyExclusiveCheckBox is an ASP.NET AJAX extender that can be attached to any ASP.NET
CheckBox control. By adding a number of checkboxes to the same "Key", only one checkbox
with the specified key can be checked at a time. This extender is useful when a number of
choices are available but only one can be chosen, similar to a radio button. The use of
checkboxes however allows you to choose to uncheck a value which is not possible normally
with radio buttons. This also provides a more consistent and expected interface than using
javascript to allow the de-selection of a RadioButton item.
The control above is initialized with this code.
<ajaxToolkit:MutuallyExclusiveCheckboxExtender runat="server"
ID="MustHaveGuestBedroomCheckBoxEx"
TargetControlID="MustHaveGuestBedroomCheckBox"
Key="GuestBedroomCheckBoxes" />
- TargetControlID - The ID of the CheckBox to modify
- Key - The unique key to use to associate checkboxes. This key does not
respect INamingContainer renaming.
|
How Do I: Use the ASP.NET AJAX MutuallyExclusive Checkbox Extender?
The MutuallyExclusive control from the ASP.NET AJAX Control Toolkit enables the developer to configure
a number of check boxes as mutually exclusive, which ensures the user may only check a single option.
While a radio-button list provides similar behavior, the need for a check box to be clicked by the user
makes the MutuallyExclusive control ideal for receiving confirmation from the user, such as
accepting or not accepting terms of use.
Watch the Video
|