# OnClientToggleStateChanged

The **toggleStateChanged** event is subsequent to the [toggleStateChanging](https://www.telerik.com/products/aspnet-ajax/documentation/controls/togglebutton/client-side-programming/events/onclienttogglestatechanging) event, and occurs when the **RadToggleButton** state is changed.

The event handler receives two parameters:

1. The instance of the clicked RadToggleButton control.

2. An eventArgs parameter of type **Telerik.Web.UI.RadButtonCheckedEventArgs**, containing the following properties and methods:

   * get_currentToggleState() - returns the current **RadButtonToggleState** object applied to the button.

   * get_commandName() - returns the value assigned to the RadToggleButton's **CommandName** property.

   * get_commandArgument() - returns the value assigned to the RadToggleButton's **CommandArgument** property.

This event is useful when the user wants to execute custom client code when the button changes its toggle state.

> caption Example 1: Using the OnClientToggleStateChanged event to get the text of the currently selected state.

```ASP.NET
<script type="text/javascript">
    function toggleStateChanged(sender, args) {
        alert(args.get_currentToggleState().get_text());
    }
</script>

<telerik:RadToggleButton ID="RadToggleButton1" runat="server"
    AutoPostBack="false" OnClientToggleStateChanged="toggleStateChanged">
    <ToggleStates>
        <telerik:ButtonToggleState Text="State 1" />
        <telerik:ButtonToggleState Text="State 2" />
    </ToggleStates>
</telerik:RadToggleButton>
```

## See Also

* [ToggleButton Object](https://www.telerik.com/products/aspnet-ajax/documentation/controls/togglebutton/client-side-programming/togglebutton-object)

* [OnClientClicking](https://www.telerik.com/products/aspnet-ajax/documentation/controls/togglebutton/client-side-programming/events/onclientclicking)

* [OnClientToggleStateChanging](https://www.telerik.com/products/aspnet-ajax/documentation/controls/togglebutton/client-side-programming/events/onclienttogglestatechanging)

* [OnClientClicked](https://www.telerik.com/products/aspnet-ajax/documentation/controls/togglebutton/client-side-programming/events/onclientclicked)
