# Events

The Telerik UI Dialog component for ASP.NET MVC exposes the [`Close`, `Hide`, `InitOpen`, `Open`, and `Show` events](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/dialogeventbuilder). You can handle these events to implement custom functionality.

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

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

```Razor HtmlHelper
    @(Html.Kendo().Dialog()
        .Name("dialog")
        .Events(e => e
            .InitOpen("onInitOpen")
            .Open("dialog_open")
            .Close("dialog_close")
            .Show("onShow")
            .Hide("onHide")
        )
    )
    <script>
        function onInitOpen(e) {
            // Handle the InitOpen event.
        }

        function onOpen(e) {
            // Handle the open event.
        }

        function onClose(e) {
            // Handle the close event.
        }

        function onShow(e) {
            // Handle the show event.
        }

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

## Next Steps

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

## See Also

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