RadConfirm with resources from Server Side

3 posts, 1 answers
  1. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 11 Jun 2012 Link to this post

    I have a problem with radconfirm control.

    Scenario: master/Page

    If I use resources does not work, but If I hardcode the title and text works perfectly:
    (Resources exists, and fill variables ok.)

    It is my code:

                        textMessage = _resources.GetString("DeleteCommunityWithUserText",
                                                           new CultureInfo(Master.Culture)).Replace("{0}",
                        textMessage = _resources.GetString("DeleteCommunityText", new CultureInfo(Master.Culture)).Replace("{0}", Session["Name"].ToString());

                    string titleMessage = _resources.GetString("DeleteCommunityTitle", new CultureInfo(Master.Culture)).Replace("{0}", Session["Name"].ToString());

                    RadWindowManager1.RadConfirm(textMessage,"confirmCallBackFn", 330,100, null,titleMessage);

    does not show radconfirm

    but if I do this:

    string  textMessage  ="Test";
    string titleMessage  ="Message";

         RadWindowManager1.RadConfirm(textMessage,"confirmCallBackFn", 330,100, null,titleMessage); 

    Show the radconfirm and works perfectly.

    Please I need help!!!

  2. Answer
    Marin Bratanov
    Marin Bratanov avatar
    5709 posts

    Posted 12 Jun 2012 Link to this post

    Hi July,

    Can you check your page for a JavaScript error in the case when the resource is used? What it seems to me is that the string you get contains special characters that break the JavaScript functions that the RadConfirm requires (e.g. apostrophes).

    What I would advise is that you first examine the following help article on the matter: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-dialogs-from-the-server-methods.html and then debug your code and see what is the exact string you get that breaks the JavaScript strings. You can output is, for example, in a label to be able to compare easily. If you register a call for a simple alert with it you should get a similar error.

    All the best,
    Marin Bratanov
    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. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 12 Jun 2012 Link to this post

    I use '{0}' on resources files,
    I replace this by {0} an is working

Back to Top