# Events

The Telerik UI DateInput for ASP.NET MVC exposes an [events](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/dateinputeventbuilder) configuration that allows you to control and customize the behavior of the component.

For a runnable example of how to handle DateInput events, refer to the [demo on using the events of the DateInput](https://demos.telerik.com/aspnet-mvc/dateinput/events).

## Handling by Handler Name

The following example demonstrates how to subscribe to the [`Change`](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/dateinputeventbuilder#changesystemstring) event by a handler name.

```Razor HtmlHelper
    @(Html.Kendo().DateInput()
        .Name("dateinput")
        .Events(e => e
            .Change("onChange")
        )
    )
```

```JavaScript
    function onChange() {
        // Handle the change event.
    }
```

## Handling by Template Delegate

The following example demonstrates how to subscribe to [`Change`](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/dateinputeventbuilder#changesystemfunc) event by a template delegate.

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

## Next Steps

* [Using the DateInput Events (Demo)](https://demos.telerik.com/aspnet-mvc/dateinput/events)

## See Also

* [Using the API of the DateInput HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/dateinput/api)
* [Server-Side API of the DateInput](https://www.telerik.com/aspnet-mvc/documentation/api/dateinput)
* [Client-Side API of the DateInput](https://docs.telerik.com/kendo-ui/api/ui/dateinput)
