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

Confirm Dialog not working properly.

3 Answers 267 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Guruvu
Top achievements
Rank 1
Guruvu asked on 27 Jan 2011, 10:32 AM
Hi,

In my application i have a Delete button with validation.I need to confirm the record before deleting.Here is my source code below:

<telerik:RadButton ID="btnUSDelete" runat="server" Skin="Sunset"  Text="Delete" 
                                               ValidationGroup="UserSettings"  onclick="btnUSDelete_Click" OnClientClicking="OnClientClicking123">
                                           </telerik:RadButton>

<script type="text/javascript">
    function OnClientClicking123(sender, args) 
    {
        var callBackFunction = Function.createDelegate(sender, function(argument) 
        {
            if (argument) 
            {
                this.click();
            }
        });      
        var text = "Are you sure you want to delete this record?";
        return confirm(text, callBackFunction, 300, 100, null, "Title");
        args.set_cancel(true);
    }
</script>

If i click on delete button,validation not working and directly confirm dialog coming.

If i click OK on confirm dialog no action takes place(i.e,Record not deleting.).

How to solve above issues? Please help me...

Thanks in advance...

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 01 Feb 2011, 02:14 PM
Hi guruvu,

Try by calling args.set_cancel() before calling the confirm function. You can also try using radconfirm for this purpose.

Best wishes,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
TonyG
Top achievements
Rank 1
answered on 16 Mar 2012, 11:53 PM
This radconfirm link is no longer valid. I'm struggling in this area and am looking around for working examples or clues about why confirm dialogs may not work.
http://www.telerik.com/help/aspnet-ajax/window_dialogsconfirm.html
0
Tsvetina
Telerik team
answered on 19 Mar 2012, 05:59 PM
Hello Tony,

Try out this link:
http://www.telerik.com/help/aspnet-ajax/window-dialogs-confirm.html

Regards,
Tsvetina
the Telerik team
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 RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Guruvu
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
TonyG
Top achievements
Rank 1
Share this question
or