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

Passing a Parameter Dynamically to a Dialog Action Button


Product Telerik UI for ASP.NET Core Dialog
Progress Telerik UI for ASP.NET Core version Created with the 2023.3.1010 version


How can I pass a parameter dynamically to a specified action button of a Dialog before opening the Dialog?


  1. Create a Button to open the Dialog when clicked.
  2. Get a reference to the hidden Dialog within the Button's Click event handler.
  3. Access the current actions configuration of the Dialog.
  4. Set a new callback function of the Action and pass the desired parameter.
  5. Call the setOptions() method to update the Dialog's actions settings.
  6. Open the Dialog by using the open() method.

            .Content("Open Dialog")
            .Title("Confirm Remove User")
            .Content("<p>Are you sure you want to Remove this User?<p>")
            .Actions(actions =>
        @addTagHelper *, Kendo.Mvc
        <kendo-button name="openDialogBtn" on-click="onClick">
            Open Dialog
        <kendo-dialog name="dialog" title="Confirm Remove User" width="400" modal="true" visible="false">
                <action text="Cancel"></action>
                <action text="Confirm" primary="true" action="onConfirmRemoveUser"></action>
                <p>Are you sure you want to Remove this User?</p>
            function onClick() {
                var customParam = "ABC123";
                var dialog = $('#dialog').data("kendoDialog");
                let dialogActions = dialog.options.actions;
                dialogActions[1].action = function() { // Update the callback function of the "Confirm" action.
                    return onConfirmRemoveUser(customParam);
                dialog.setOptions({actions: dialogActions});
            function onConfirmRemoveUser(idParam) {

For a runnable example based on the code above, refer to the following REPL samples:

More ASP.NET Core Dialog Resources

See Also

In this article