Dialog Overview

Telerik UI for ASP.NET Core Ninja image

The Dialog is part of Telerik UI for ASP.NET Core, a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

The Telerik UI Dialog TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI Dialog widget.

The Dialog is a modal popup that brings information to the user. It also provides actions through its action buttons to prompt the user for input or to ask for a decision. The component can also contain more complex UI elements that require the focus of the user. The Dialog is a subset of the Kendo UI for jQuery Window where the most prominent difference is the added functionality for actions and predefined dialogs.

Initializing the Dialog

The Dialog is often opened as a result of a user action rather than of the load event of the page. Basically, you can initialize the widget as non-visible and open it when needed.

The following example demonstrates how to define the Dialog.

        .Name("dialog") // The name of the Dialog is mandatory. It specifies the "id" attribute of the widget.
        .Title("Software Update")// Set the title of the Dialog.
        .Content("Do you agree terms and conditions?") // Define the content of the Dialog.
        .Visible(false) // The widget will be initialized as invisible.
    <kendo-dialog name="dialog1">
        <content>Dialog contents</content>

Basic Configuration

The Dialog provides default configuration options that can be set during initialization such as its height and width, custom action buttons, title and Close buttons, animation effects and duration, and so on.

The following example demonstrates a basic configuration of the Dialog.

        .Title("Software Update")
        .Content("Do you agree terms and conditions?")
        .Width(400)  // Set the width of the Dialog.
        .Modal(false) // Disable the modality of the Dialog.
        .ButtonLayout("stretched") // Set a "stretched" layout for the action buttons.
        .Actions(actions =>
            actions.Add().Text("NO"); // Set text of the first button.
            actions.Add().Text("YES").Primary(true); // Set text of the second button and define it as primary.

    <script type="text/javascript">
        $(function() {
            // The Name() of the Dialog is used to get its client-side instance.
            var dialog = $("#dialog").data("kendoDialog");
    <kendo-dialog name="dialog" title="Software Update" modal="false" on-close="dialog_close">
            <p>A new version of <strong>Kendo UI</strong> is available. Would you like to download and install it now?<p>
            <action text="Skip this version">
            <action text="Remind me later">
            <action primary="true" text="Install update">

Functionality and Features


You can subscribe to all Dialog events. For a complete example on basic Dialog events, refer to the demo on using the events of the Dialog.

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

        .Events(e => e
        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.

The full list of events with explanations of when they are triggered is available here:

See Also

In this article