ASP.NET MVC confirmation dialog

3 posts, 1 answers
  1. Emin Inam
    Emin Inam avatar
    6 posts
    Member since:
    Oct 2004

    Posted 13 Jan 2017 Link to this post

    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. Answer
    Slav
    Admin
    Slav avatar
    1359 posts

    Posted 17 Jan 2017 Link to this post

    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.
  3. Emin Inam
    Emin Inam avatar
    6 posts
    Member since:
    Oct 2004

    Posted 23 Jan 2017 in reply to Slav Link to this post

    Thnak you. I fixed the problem according to your suggestion
Back to Top