# Events

The Switch for ASP.NET Core exposes the [`Change()` event](https://docs.telerik.com/aspnet-core/api/kendo.mvc.ui.fluent/switcheventbuilder#changesystemstring) that you can use for capturing the Switch's value during user interaction.

For a complete example on Switch events, refer to the [demo on using the events of the Slider](https://demos.telerik.com/aspnet-core/switch/events).

### Handling by Handler Name

The following example demonstrates how to subscribe to events by a handler name.

```Razor HtmlHelper
    @(Html.Kendo().Switch()
        .Name("switch")
        .Events(e => e
            .Change("change")
        )
    )
    <script>
        function change(e) {
            // Handle the change event.
        }
    </script>
```

```Razor TagHelper
    <kendo-switch name="switch" on-change="change"></kendo-switch>
    <script>
        function change(e) {
            // Handle the change event.
        }
    </script>
```

### Handling by Template Delegate

The following example demonstrates how to subscribe to events by a template delegate.

```Razor HtmlHelper
    @(Html.Kendo().Switch()
        .Name("switch")
        .Events(e => e
            .Change(@<text>
              function(e) {
                  // Handle the change event inline.
              }
            </text>)
        )
    )
```

```Razor TagHelper
    <kendo-switch name="switch"
              on-change="function() {
                 // Handle the change event inline.
              }">
    </kendo-switch>
```

## Next Steps

* [Using the Switch Events (Demo)](https://demos.telerik.com/aspnet-core/switch/events)

## See Also

* [Using the API of the Switch for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/switch/api)
* [Switch Server-Side API for ASP.NET Core](https://www.telerik.com/aspnet-core-ui/documentation/api/switch)
* [Switch Client-Side API](https://docs.telerik.com/kendo-ui/api/ui/switch)
