Multiple radconfirm dialog on a single page with different calls.

5 posts, 0 answers
  1. Rakesh
    Rakesh avatar
    1 posts
    Member since:
    Nov 2011

    Posted 04 Nov 2011 Link to this post

    Hi,
    I am using radconfirm dialog box to show a confirmation if user wants to remove the records with OK button and cancel link.
    Now I am trying to implement radconfirm dialog box to show a confirmation to user when he click on open button; then a confirmation popup should open which will say "Hey, do you want to save it". it will have 2 buttons - yes, no. here cancel link will not come.

    Please suggest How I can implement 2 radconfirm on single page or I can reuse the existing radconfirm dialog box and how?

    thanks
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 07 Nov 2011 Link to this post

    Hi Rakesh,

    I can suggest several options to achieve your scenario:

    1) Create a RadWindow that will have the proper styling (modal, only close behavior enabled, etc) and in its ContentTemplate you can place buttons and content as you desire, then open it instead of the RadConfirm. This allows you to have directly server-side handlers for the button clicks

    OR

    2) add a second RadWindowManager at the end of the form and modify its ConfirmTemplate. THen if you need the second type of confirm box call it explicitly from this manager, i.e.:
    var secondMngr = $find("secondManagerClientID");
    secondMngr.radconfirm("sure?", secondCallBackFn);

    OR

    3) Change the text via JavaScript, for example: var oConfirm = radconfirm("sure", null);
    $telerik.$(".rwInnerSpan", oConfirm.get_popupElement())[1].innerHTML = "my Text";

    4) Change the string via the localization, as shown in this kb article before calling the confirm dialog. Note that this is a global setting.

    Best wishes,
    Marin
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Nov 2011 Link to this post

    Hello Rakesh,

    You can try the following method as well with some javaScript.
    JS:
    //radalert
    var oAlert = radalert("test");
    var alertOKbtn = $telerik.getElementByClassName(oAlert.get_contentElement(), "rwInnerSpan", "span");
    alertOKbtn.innerHTML = "OKTextAlert";
      
    //radconfirm
    var oConfirm = radconfirm("test");
    var confirmOKbtn = $telerik.getElementByClassName(oConfirm.get_contentElement(), "rwInnerSpan", "span");
    confirmOKbtn.innerHTML = "OKTextConfirm";

    Thanks,
    Princy.
  5. Scott
    Scott avatar
    1 posts
    Member since:
    Mar 2016

    Posted 09 May Link to this post

    does anyone have a C# controls to help with Radconfrim communication with the Code Behind as in :

    Server Side MsgBox User Control for radconfirm, radalert and radprompt

    http://www.telerik.com/support/code-library/server-side-msgbox-user-control-for-radconfirm-radalert-and-radprompt


     

  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 10 May Link to this post

    Hi Scott,

    RadConfirm can be called via a built-in server method in RadWindowManager: http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx.

    To use it in the code-behind logic, I advise you review the following help article: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/using-radconfirm-in-server-code.

    To confirm client-side clicks on buttons (or other client-side actions), review the following demo: http://demos.telerik.com/aspnet-ajax/window/examples/confirmserverclicks/defaultcs.aspx. I advise you review its description in detail because it explains some important aspects of what can be done and how.

    Regards,

    Marin Bratanov
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017