Change Yes and No Buttons on radconfirm prompt

5 posts, 0 answers
  1. Aret
    Aret avatar
    29 posts
    Member since:
    Oct 2011

    Posted 09 Jan 2013 Link to this post

    Greetings,

    Before I state my quesiton, I want to make it clear that I am using a very old version of the Rad Controls or in other words I do not have the latest RadConrols asp.net ajax. With that being said, the issue I am having is being able to change the text of my yes and no buttons on my rad confirm dialog box. Currently this is how I am calling my rad confirm and everything is working. 

    VB.NET code that calls the radconfirm

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

     radAjax.ResponseScripts.Add("radconfirm('Your answers have been submitted.', callBack,  290, 110, '', 'Answers Submitted');")

    End Sub



    ASP Page code:

        function callBack(args) {

             if (args) {

                 document.getElementById('<%= btnRedirect.ClientID %>').click();

             }
         }


      <div>
      <asp:Button ID="btnRedirect" OnClick="btnRedirect_Click" runat="server" Text="" />
      </div>


      <radW:RadWindowManager ID="RadWindowManager1"  EnableShadow="true" runat="server">
      </radW:RadWindowManager>




    How would I be able to change the text in my radconfirm, by still using this method in calling my prompt.....?

    I also found a localization file under my radcontrols folder which is an XML file that display this information:

    <?xml version="1.0" encoding="utf-8" ?>
    <localization>
        <string id="Maximize">Maximize</string>
        <string id="Minimize">Minimize</string>
        <string id="Close">Close</string>
        <string id="Restore">Restore</string>    
        <string id="PinOff">Pin Off</string>
        <string id="PinOn">Pin On</string>
        <string id="ConfirmMessage">Are you sure?</string>
        <string id="PromptMessage">Enter value:</string>
        <string id="Ok">Ok</string>
        <string id="Cancel">Cancel</string>
        <string id="Yes">Yes</string>
        <string id="No">No</string>
        <string id="Loading">Loading...</string>
        <string id="Reload">Reload</string>    
        <string id="Alert">RadWindow alert</string>
        <string id="Prompt">RadWindow prompt</string>
        <string id="Confirm">RadWindow confirm</string>    
    </localization>


    I do not want to change the Text in this file because it would then affect all my rad confirm prompts on my other web pages.


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Jan 2013 Link to this post

    Hi Aret,

    Try the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" EnableShadow="true" runat="server"  Localization-OK="confirm" Localization-Cancel="don't confirm">
    </telerik:RadWindowManager>

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aret
    Aret avatar
    29 posts
    Member since:
    Oct 2011

    Posted 10 Jan 2013 Link to this post

    I just tried that code snippet and it does not work.  Is there another way.
  5. Aret
    Aret avatar
    29 posts
    Member since:
    Oct 2011

    Posted 10 Jan 2013 Link to this post

    It seems I have the ASP.NET Classic controls from Telerik.  Does not seem like there is any such thing as a Localization property for any of my Telerik controls.
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Jan 2013 Link to this post

    Hi,

    Unfortunately I cannot replicate the issue at my end. Try changing the text as shown below.
    JS:
    Telerik.Web.UI.RadWindowUtils.Localization = 
    {
        "OK" : "confirm",
        "Cancel" : "don't confirm"
    };
    Also check the following help documentation.
    Changing the localization of RadWindow for ASP.NET AJAX

    Regards,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017