# Events

The Telerik UI Responsive Panel for ASP.NET Core exposes [`Open`](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/responsivepaneleventbuilder#opensystemstring) and [`Close`](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/responsivepaneleventbuilder#closesystemstring) events that allow you to control the behavior of the UI component.

The following example demonstrates how to subscribe to the component events.

```Razor HtmlHelper
    @(Html.Kendo().ResponsivePanel()
        .Name("sidebar")
        .Events(e => 
        {
            e.Open("onOpen");
            e.Close("onClose");
        })
        ... // Other configuration.
    )

    <script>
        function onOpen(e) {
            console.log(e); // Review the event data.
            // Custom logic before the componen opens.
        }

        function onClose(e) {
            console.log(e); // Review the event data.
            // Custom logic before the componen closes.
        }
    </script>
```

```Razor TagHelper
    <kendo-responsivepanel name="slidebar" on-open="onOpen" on-close="onClose">
        
    </kendo-responsivepanel>

    <script>
        function onOpen(e) {
            console.log(e); // Review the event data.
            // Custom logic when the componen opens.
        }

        function onClose(e) {
            console.log(e); // Review the event data.
            // Custom logic when the componen closes.
        }
    </script>
```

## See Also

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

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

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