Hi Wout,
Greetings from Syncfusion support,
We have validated your reported query. In order to call the controller action, from the view of the dialog button. We suggest you to bind the click event, for the dialog buttons and navigate to the controller action using (@Url.Action). Check the below code blocks and sample for reference.
cshtml
<div id='container' style="height:400px;">
<ejs-button id="targetButton" content="Open Dialog"></ejs-button>
<ejs-dialog id="dialog" header="Dialog" content="This is a Dialog with button and primary button" target="#container" width="250px">
<e-dialog-buttons>
<e-dialog-dialogbutton buttonModel="@ViewBag.DialogButtons1" click="dlgButtonClick"></e-dialog-dialogbutton>
</e-dialog-buttons>
</ejs-dialog>
</div>
<script>
window.onload = function () {
document.getElementById('targetButton').onclick = function () {
var dialog = document.getElementById("dialog").ej2_instances[0];
dialog.show();
}
}
function dlgButtonClick() {
location.rel='nofollow' href = '@Url.Action("Delete", "Home")';
}
</script>
|
Controller.cs
public async Task Delete()
{
//Your delete action
} |
Please let us know if the solution helps,
Regards,
Indrajith