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

RadConfirm Yes/No buttons with post back on either button

1 Answer 350 Views
Window
This is a migrated thread and some comments may be shown as answers.
EJ
Top achievements
Rank 1
EJ asked on 16 Nov 2015, 11:27 AM

I'm trying to figure out to I can show the generic radConfirm with "Yes" or "No" buttons instead of "OK" and "Cancel" buttons and have a post back occur when either "yes" or "no" occur to a different button. Right now I'm invoking radConfirm server-side using this 

 

code behind c#

 

              ShowConfirm("Are you sure that you want to use special option?", ConfirmPerformActionButton.UniqueID);

 

        private void ShowConfirm(string dialogText, string postBackUrl)
        {
            string script = string.Format("showConfirm(\"{0}\",\"{1}\");", dialogText, postBackUrl); ;
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "KEY", script, true);
        }

 

on the ascx i have

 

<script type="text/javascript">

    var confirmPostBackUrl;
    function showConfirm(dialogText, postBackUrl) {
        function f() {
            confirmPostBackUrl = postBackUrl;
            Sys.Application.remove_load(f);
            radconfirm(dialogText, confirmCallback);
        }
        Sys.Application.add_load(f);
    }
    function confirmCallback(arg) {
        if (arg) {
            __doPostBack(confirmPostBackUrl, '');
        }
    }
</script>

on master page i have

    <telerik:RadWindowManager ID="MasterRadWindowManager" runat="server">
    </telerik:RadWindowManager>

 

thanks for any suggestions!
 

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 16 Nov 2015, 01:20 PM

Hi,

The localization features the control offers let you set the buttons text: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/accessibility-and-internationalization/localization. An alternative is to change the confirm template: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/alert,-confirm,-prompt-dialogs/how-to-change-the-dialog-templates.

You may also find useful this article that shows how you can use a confirm dialog from the server code: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/using-radconfirm-in-server-code. The third approach shows how you can use custom buttons that can have any text/icons/postback events you want.

Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Window
Asked by
EJ
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or