# Events

You can subscribe to the `Open`, `Close`, and `Change` [DateTimePicker events](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/datepickereventbuilderbase) and further customize the functionality of the component.

For a complete example on basic DateTimePicker events, refer to the [demo on using the events of the DateRangePicker](https://demos.telerik.com/aspnet-mvc/datetimepicker/events).

## Handling Events by Handler Name

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

```Razor HtmlHelper
    @(Html.Kendo().DateTimePicker()
      .Name("datetimepicker")
      .Events(e => e
            .Open("datetimepicker_open")
            .Close("datetimepicker_close")
            .Change("datetimepicker_change")
      )
    )
```

```JavaScript
    function datetimepicker_open() {
        // Handle the open event.
    }

    function datetimepicker_close() {
        // Handle the close event.
    }

    function datetimepicker_change() {
        // Handle the change event.
    }

```

### Handling Events by Template Delegate

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

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

## Next Steps

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

## See Also

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