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

Postback with radconfirm

2 Answers 82 Views
Window
This is a migrated thread and some comments may be shown as answers.
Saeid Kdaimati
Top achievements
Rank 2
Saeid Kdaimati asked on 20 Sep 2013, 07:29 AM
Hi,

I'm using rad confirm for two reasons:
1. display a message from a server after some action
2. Confirm before delete

This is my code:
ASPX
<asp:Panel ID="Panel1" runat="server">
    <script>
        function confirmCallBackFn(arg) {
            if (arg == true) {
                __doPostBack("<%#deleteBtn.ClientID %>", "");
            }
        }
    </script>
    </asp:Panel>
<asp:Button ID="deleteBtn" runat="server" CausesValidation="false" Text="Delete" OnClientClick="radconfirm('Are you sure you want to delete?', confirmCallBackFn, 330, 180, null, 'OFFIS - Confirm Delete', null); return false;" OnClick="deleteBtn_Click" />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="True"></telerik:RadWindowManager>

CS
OnPageLoad()
Panel1.DataBind();
 
OnAction
RadWindowManager1.RadAlert(MessageHelper.errorOccurred("Insufficient Fund"), 330, 180, "Security Alert", null);

The problem I have is after clicking Delete button, a confirm window shows up, but it does not do the post back after clicking yes.

Can you help me please?

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 20 Sep 2013, 10:07 AM
Hello Saeid,

I advise you start off with examining the following two resources:
- http://demos.telerik.com/aspnet-ajax/window/examples/confirmserverclicks/defaultcs.aspx - shows how a confirm dialog can be shown to confirm a click on a button. Note how the UniqueID (i.e., the name attribute) of a button is used
- http://www.telerik.com/help/aspnet-ajax/window-using-radconfirm-in-server-code.html - on similar integration of a RadConfirm, but from the server-side code alone. Note how a callback function invokes a second postback. In your server code for the alert there is no callback function defined
- http://www.telerik.com/help/aspnet-ajax/window-dialogs-alert.html - shows the syntax of calling a RadAlert

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 RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Saeid Kdaimati
Top achievements
Rank 2
answered on 23 Sep 2013, 06:33 AM
Thank you Marin.
Tags
Window
Asked by
Saeid Kdaimati
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Saeid Kdaimati
Top achievements
Rank 2
Share this question
or