New to Telerik UI for ASP.NET Core? Download free 30-day trial

Events

The Telerik UI Window for ASP.NET Core exposes multiple events that allow you to control and customize the behavior of the UI component.

For a complete example on basic Window events, refer to the demo on using the events of the Window.

Handling by Handler Name

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

    @(Html.Kendo().Window()
        .Name("window")
        .Events(e => e
            .Open("window_open")
            .Close("window_close")
        )
    )
    <kendo-window name="window" on-open="window_open" on-close="window_close">
    </kendo-window>
    <script>
        function window_open() {
            // Handle the open event.
        }

        function window_close() {
            // Handle the close event.
        }
    </script>

Handling by Template Delegate

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

    @(Html.Kendo().Window()
        .Name("window")
        .Events(e => e
            .Open(@<text>
                function() {
                    // Handle the open event inline.
                }
            </text>)
            .Close(@<text>
                function() {
                    // Handle the close event inline.
                }
            </text>)
        )
    )
    <kendo-window name="window"
     on-open="function() {
        //Handle the open event inline.
    }"
     on-close="function() {
       //Handle the open event inline.
    }">
    </kendo-window>

Next Steps

See Also

In this article