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

Events

The Telerik UI DateInput for ASP.NET Core exposes an events configuration that allows you to control and customize the behavior of the component.

For a runnable example of how to handle DateInput events, refer to the demo on using the events of the DateInput.

Handling by Handler Name

The following example demonstrates how to subscribe to the Change event by a handler name.

    @(Html.Kendo().DateInput()
        .Name("dateinput")
        .Events(e => e
            .Change("onChange")
        )
    )
    @addTagHelper *, Kendo.Mvc

    <kendo-dateinput name="dateinput"
        on-change="onChange">
    </kendo-dateinput>
    function onChange() {
        // Handle the change event.
    }

Handling by Template Delegate

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

    @(Html.Kendo().DateInput()
        .Name("dateinput")
        .Events(e => e
            .Change(@<text>
                function() {
                    // Handle the change event inline.
                }
            </text>)
        )
    )
    @addTagHelper *, Kendo.Mvc

    <kendo-dateinput name="dateinput"
        on-change="function() {
            // Handle the change event inline.
        }">
    </kendo-dateinput>

Next Steps

See Also

In this article