# Events

The Telerik UI Slider for ASP.NET Core exposes [`Change`](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/slidereventbuilder#changesystemstring) and [`Slide`](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/slidereventbuilder#slidesystemstring) events that allow you to control the behavior of the UI component.

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

## Handling by Handler Name

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

```Razor HtmlHelper
    @(Html.Kendo().Slider()
        .Name("slider")
        .Events(e => e
            .Change("change")
            .Slide("slide")
        )
    )

    <script>
        function change(e) {
            // Handle the change event.
        }

        function slide(e) {
            // Handle the slide event.
        }
    </script>
```

```Razor TagHelper
    <kendo-slider name="slider"
        on-change="change"
        on-slide="slide"
    </kendo-slider>

    <script>
        function change(e) {
            // Handle the change event.
        }

        function slide(e) {
            // Handle the slide event.
        }
    </script>
```

## Handling by Template Delegate

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

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

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

## See Also

* [Client-Side API of the Slider](https://docs.telerik.com/kendo-ui/api/ui/slider)

* [Server-Side API of the Slider HtmlHelper](https://www.telerik.com/aspnet-core-ui/documentation/api/slider)

* [Server-Side API of the Slider TagHelper](https://www.telerik.com/aspnet-core-ui/documentation/api/taghelpers/slider)
