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

Client-side Events

Event log

RadSwitch provides the following client-side events:

  • OnClientCheckedChanging - raised when the user changes the state of the switch. The event can be canceled.
  • OnClientCheckedChanged - raised when the user changes the state of the switch. The event is subsequent to the OnClientCheckedChanging event.
  • OnClientClicking - raised when the user clicks the switch. The event can be canceled.
  • OnClientClicked - raised when the switch has been clicked. The event is subsequent to the OnClientClicking event.
  • OnClientLoad - raised when the switch is loaded.
  • OnClientMouseOver - raised when the mouse pointer is positioned over the switch.
  • OnClientMouseOut - raised when the mouse pointer leaves the switch.
  • 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 ID="RadSwitch1" runat="server" Width="65px"
            AutoPostBack="false"
            OnClientCheckedChanging="telerikDemo.onClientCheckedChanging"
            OnClientCheckedChanged="telerikDemo.onClientCheckedChanged"
            OnClientClicking="telerikDemo.onClientClicking"
            OnClientClicked="telerikDemo.onClientClicked"
            OnClientLoad="telerikDemo.onClientLoad"
            OnClientMouseOver="telerikDemo.onClientMouseOver"
            OnClientMouseOut="telerikDemo.onClientMouseOut">
            <ToggleStates>
                <ToggleStateOn Text="Yes" />
                <ToggleStateOff Text="No" />
            </ToggleStates>
        </telerik:RadSwitch>
    </div>
    <qsf:EventLogConsole ID="EventLogConsole" runat="server" AllowClear="true"></qsf:EventLogConsole>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance