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

Server-side Events

Event log

RadToggleButton exposes several server-side events that allow easy and flexible use in a wide range of application scenarios:

  • OnClick—raised when the RadToggleButton is clicked and AutoPostBack is set to true.
  • OnCommand—raised when the RadToggleButton is clicked and AutoPostBack is set to true. It is useful for handling commands (using the CommandName and CommandArgument properties).
  • OnToggleStateChanged—raised when the state of RadToggleButton changes and AutoPostBack is set to true.
  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • styles.css
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="ToggleButton.ServerSideApi.ServerSideEvents.DefaultVB" %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-containers">
        <div class="demo-container size-thin">
            <telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="CustomToggle Button" CommandName="Play" OnClick="Button_Click" 
                OnCommand="CommandBtn_Click" OnToggleStateChanged="ToggleState_Changed" Width="100px">
                <ToggleStates>
                    <telerik:ButtonToggleState Text="Mute" Icon-CssClass="mute-icon"></telerik:ButtonToggleState>
                    <telerik:ButtonToggleState Text="Low" Icon-CssClass="low-icon"></telerik:ButtonToggleState>
                    <telerik:ButtonToggleState Text="High" Icon-CssClass="high-icon"></telerik:ButtonToggleState>
                </ToggleStates>
            </telerik:RadToggleButton>

            <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadToggleButton1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="EventLogConsole1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>

            <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
        </div>
    </div>
    <qsf:EventLogConsole ID="EventLogConsole1" runat="server" AllowClear="true" Height="200px"></qsf:EventLogConsole>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance