This is a migrated thread and some comments may be shown as answers.

ASP.NET MVC confirmation dialog

2 Answers 1465 Views
Dialog
This is a migrated thread and some comments may be shown as answers.
Emin Inam
Top achievements
Rank 1
Emin Inam asked on 13 Jan 2017, 08:38 PM

Hi,

I need ASP.NET MVC confirmation dialog with dialog result.

I have a command button. When the user click button, i want to show confirmation dialog and if user click YES, set function will be call.

I took a look at the examples. "Create Confirmation Dialog via Promises" is seems to fine. but it doesn't work at my IDE.

I also tried to kendo.confirm. it works but The result is empty when I click on the button for the second time

<div id="confirm"></div><script> $("#confirm").kendoConfirm({ content: "Do you accept?", messages:{ okText: "OK"}}).data("kendoConfirm").result.done(function(){console.log("User accepted"); }).fail(function(){console.log("User rejected");});</script>

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Slav
Telerik team
answered on 17 Jan 2017, 11:02 AM

Hello Emin,

The Create Confirmation Dialog via Promises example (http://www.kendoui.io/kendo-ui/web/window/how-to/confirmation-dialog-promise) is indeed one way to achieve the described functionality. Could you please provide more information about the error preventing you from using it as the previous post does not clarify that? Is it possible to send a fully runnable sample that shows the issue, or modify the following example in Dojo for the same purpose: http://dojo.telerik.com/UVUWU

As for the confirm dialog, it does not show up, because it is disposed when closed. One option is to use the confirm method (http://docs.telerik.com/kendo-ui/api/javascript/kendo#methods-confirm), which handles this automatically: http://dojo.telerik.com/EMaTUL

The other possible approach is to keep using kendoConfirm and move the initialization in a method that will be called each time the button is pressed. This way the confirm dialog will be initialized each time you want to display it.



Regards,
Slav
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Emin Inam
Top achievements
Rank 1
answered on 23 Jan 2017, 09:57 AM
Thnak you. I fixed the problem according to your suggestion
Tags
Dialog
Asked by
Emin Inam
Top achievements
Rank 1
Answers by
Slav
Telerik team
Emin Inam
Top achievements
Rank 1
Share this question
or