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

RadConfirm user click

1 Answer 25 Views
Window
This is a migrated thread and some comments may be shown as answers.
Damian
Top achievements
Rank 1
Damian asked on 31 Jul 2013, 06:12 PM
Hi Telerik

I am using RadConfirm dialog in my asp.net web form to get the user confirmations. Since the user can click OK or cancel and there is a third possibility that he can click the X button to close. Therefore how to differentiate between these user interactions?

Damian

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 01 Aug 2013, 04:49 AM
Hi Damian,

You can use the Callback function of the RadConfirm to check if the user has pressed OK/Cancel or whether he has closed the dialog. Please have a look at the following JavaScript I tried which works fine at my end. The argument of the Callback function returns null if the user directly closes the RadConfirm.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
<telerik:RadButton ID="RadButton1" runat="server" Text="Delete" OnClientClicking="confirmDelete">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function confirmDelete(sender, args) {
        args.set_cancel(true);
        radconfirm("Are you sure you want to Delete?", callbackFunction)
    }
    function callbackFunction(arg) {
        if (arg == null) {
            alert("RadConfirm is closed");
        }
        else if (arg == true) {
            alert("User Clicked OK");
        }
        else {
            alert("User Clicked Cancel");
        }
    }
</script>

Thanks,
Shinu.
Tags
Window
Asked by
Damian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or