# Events

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

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

## Handling by Handler Name

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

```Razor HtmlHelper
    @(Html.Kendo().DockManager()
        .Name("dockmanager")
        .Events(events => events.Pin("onPin"))
        .RootPane(root =>
        {
            root.Id("root")
            .Panes(panes  => {
                panes.Add().Type(PaneType.Split).Panes(top => {
                     top.Add().Id("tools")
                        .Type(PaneType.Content)
                        .Title("Tools")
                        .Content("Content");
                });
            });
        })
    )

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

## Handling by Template Delegate

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

```Razor HtmlHelper
    @(Html.Kendo().DockManager()
        .Name("dockmanager")
        .Events(events => events.Pin(@<text>
                            function(e){
                                // Handle the Pin event.
                            }
                        </text>)
        )
        .RootPane(root =>
        {
            root.Id("root")
            .Panes(panes  => {
                panes.Add().Type(PaneType.Split).Panes(top => {
                     top.Add().Id("tools")
                        .Type(PaneType.Content)
                        .Title("Tools")
                        .Content("Content");
                });
            });
        })
    )
```

## Next Steps

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

* [Using the API of the DockManager HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/dockmanager/api)

* [DockManager Server-Side API](https://www.telerik.com/aspnet-mvc/documentation/api/dockmanager)

* [DockManager Client-Side API](https://docs.telerik.com/kendo-ui/api/ui/dockmanager)
