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

RadConfirm with resources from Server Side

2 Answers 63 Views
Window
This is a migrated thread and some comments may be shown as answers.
July
Top achievements
Rank 2
July asked on 11 Jun 2012, 02:13 PM
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:

   if(Master.Organization.CommunityHasUser(GetId()))
                {
                    textMessage = _resources.GetString("DeleteCommunityWithUserText",
                                                       new CultureInfo(Master.Culture)).Replace("{0}",
                                                                                                Session["Name"].ToString
                                                                                                    ());
                }else
                {
                    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 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 12 Jun 2012, 10:49 AM
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.
0
July
Top achievements
Rank 2
answered on 12 Jun 2012, 01:02 PM
thanks!
I use '{0}' on resources files,
I replace this by {0} an is working

Thanks
Tags
Window
Asked by
July
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
July
Top achievements
Rank 2
Share this question
or