WebForms Switch Overview
The RadSwitch control (Figure 1) enriches the features, that ASP.NET Switch control has. Additionally, it provides events, supports Commands and numerous themes. RadSwitch is available as of R2 2021.
Start Free TrialFigure 1: RadSwitch configuration.
Example 1: A basic example of a RadSwitch setup.
ASP.NET
<telerik:RadLabel runat="server" ID="RadLabel1" AssociatedControlID="RadSwitch1" Text="I agree to the Terms & Conditions.">
</telerik:RadLabel>
<telerik:RadSwitch ID="RadSwitch1" runat="server" Width="65px">
<ToggleStates>
<ToggleStateOn Text="Yes" />
<ToggleStateOff Text="No" />
</ToggleStates>
</telerik:RadSwitch>
The default value of the
AutoPostBack
property istrue
, which means RadSwitch will POST the page to the server when checked/unchecked.
RadSwitch does not support a Classic render mode. Setting its RenderMode to Classic will default to the Lightweight render mode.