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

Retrieve radConfirm box responses

3 Answers 208 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
vvvv
Top achievements
Rank 1
vvvv asked on 12 Feb 2014, 07:10 PM
Hi 
I am using rad confirm box to display a message. If the user clicks yes I have to do some steps. If "no" then something else. How can I do this? Here is what I have so far. Appreciate help with this.

aspx.cs
=======
MoreInformationWindowManager.RadConfirm("This event time slot has no available openings. Would you like to be put on the wait list?", "confirmCallBackFn", 330, 180, null, "WARNING");
if(result(radconfirm) == yes)
{
some code
}
else 
{some code
}


aspx
====
function confirmCallBackFn(arg) {
            if (arg == true) {
                radalert("<strong>You have been waitlisted. An email has been sent out to you.</strong> <h3 style='color: #ff0000;'>" + arg + "</h3>", 350, 250, "CONFIRMATION");
            }
            else {
                radalert("<strong>You have cancelled the request.<strong>" ,330, 180, "CONFIRMATION", null);
               // "confirmCallBackFn", 330, 180, null, "WARNING");
            }
        }

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Feb 2014, 04:13 AM
Hi,

Unlike regular browser counterpart, the RadConfirm dialog is non-blocking, it's designed to respond via a callback. At a minimum the RadConfirm function takes two arguments, one HTML string with the message, and the name of a callback function that deals with the results. The callback takes a single parameter, whose value is True or False, depending on whether the user clicks "OK" or "Cancel". The RadConfirm returns the client result as an argument in its Callback function only, as opposed to the standard browser confirm() function - the radconfirm() function returns a reference to the RadWindow dialog that is created and not the result. The callback function is a client-side JavaScript function which is executed when the dialog is closed. Please have a look into the this help documentation for further information.

Thanks,
Princy.
0
vvvv
Top achievements
Rank 1
answered on 13 Feb 2014, 10:39 PM
Thanks for replying back Princy. Earlier I was using Message box. But I figured out that it throws errors when the server settings changes. Is there a way that I could use radconfirm in the below way or any work around for this?  Thanks

DialogResult result = MessageBox.Show("Test", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (result == DialogResult.Yes)
                    {
                        
                    }
                    else if (result == DialogResult.No)
                    {
                       
                    }
0
Marin Bratanov
Telerik team
answered on 18 Feb 2014, 08:57 AM
Hi guys,

The following help article explains how you can ask for confirmation in server code: http://www.telerik.com/help/aspnet-ajax/window-using-radconfirm-in-server-code.html. Please examine it carefully because there are several tricky moments.

Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
vvvv
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
vvvv
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or