Postback with radconfirm

3 posts, 0 answers
  1. Saeid Kdaimati
    Saeid Kdaimati avatar
    48 posts
    Member since:
    May 2006

    Posted 20 Sep 2013 Link to this post

    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. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 20 Sep 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Saeid Kdaimati
    Saeid Kdaimati avatar
    48 posts
    Member since:
    May 2006

    Posted 23 Sep 2013 Link to this post

    Thank you Marin.
Back to Top