New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Keyboard Support

This is a Switch with "AccessKey" set to "A". You can also use the Tab key to focus it and Space/Enter to execute its click.
Event log

This example demonstrates how you can use the keyboard to control a RadSwitch. You can focus a switch by using the Tab key if you set the TabIndex property of RadSwitch according to the desired flow of the page.

In addition, you can use a shortcut if you set the AccessKey property. Press Alt+AccessKey in IE and Chrome, Shift+Alt+AccessKey for Firefox and Shift+Esc+AccessKey for Opera.

To execute a selected switch press the Enter or Space key when it is focused.

Note: By default tab-access is disabled in Safari. To enable it, check "Preferences > Advanced > Press tab to highlight each item on the page".

  • DefaultVB.aspx
  • scripts.js
<%@ Page Language="vb" AutoEventWireup="true"  %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script src="scripts.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-thin" style="text-align: center">
        <telerik:RadLabel runat="server" ID="RadLabel1" AssociatedControlID="RadSwitch1" Text="I agree to the Terms & Conditions.">
        </telerik:RadLabel>
        <telerik:RadSwitch runat="server" ID="RadSwitch1" Checked="true" Width="65px"
            TabIndex="1" AccessKey="A" OnClientClicked="telerikDemo.OnClientClicked" AutoPostBack="false">
            <ToggleStates>
                <ToggleStateOn Text="Yes" />
                <ToggleStateOff Text="No" />
            </ToggleStates>
        </telerik:RadSwitch>
    </div>
    <qsf:MessageBox ID="InformationBox1" Icon="Info" Type="Info" runat="server">
        This is a Switch with "AccessKey" set to "A". You can also use the Tab key to focus it and Space/Enter to execute its click.
    </qsf:MessageBox>
    <qsf:EventLogConsole ID="EventLogConsole" runat="server" AllowClear="true"></qsf:EventLogConsole>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance