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

Localization JavaScript object on custom dialogs.

1 Answer 109 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Frank Witte
Top achievements
Rank 1
Frank Witte asked on 28 May 2009, 05:09 AM

I am creating custom dialogs using Telerik.Web.UI. DialogDefinition.

In the code behind

 

String virtualPath  ==  customdialog.ascx  
 
DialogDefinition cb3ModalDialog = new DialogDefinition(virtualPath, new DialogParameters());  
            cb3ModalDialog.Modal = true;  
            cb3ModalDialog.VisibleTitlebar = true;  
            cb3ModalDialog.VisibleStatusbar = true;  
            cb3ModalDialog.Width = Unit.Pixel(width);  
            cb3ModalDialog.Height = Unit.Pixel(height);  
            cb3ModalDialog.VisibleStatusbar = false;  
            cb3ModalDialog.Title = dialogTitle;  
            this.RadEditorControl.DialogOpener.DialogDefinitions.Add(“CB3ImageManager”, cb3ModalDialog);  
 

And in javascript

var dialogOpener = editor.get_dialogOpener();  
dialogOpener.open('CB3ImageManager', args);  
 

Localization JavaScript object on custom dialogs.

 

I am creating custom dialogs using Telerik.Web.UI. DialogDefinition.

In the code behind

 

String virtualPath  ==  customdialog.ascx

 

DialogDefinition cb3ModalDialog = new DialogDefinition(virtualPath, new DialogParameters());

            cb3ModalDialog.Modal = true;

            cb3ModalDialog.VisibleTitlebar = true;

            cb3ModalDialog.VisibleStatusbar = true;

            cb3ModalDialog.Width = Unit.Pixel(width);

            cb3ModalDialog.Height = Unit.Pixel(height);

            cb3ModalDialog.VisibleStatusbar = false;

            cb3ModalDialog.Title = dialogTitle;

            this.RadEditorControl.DialogOpener.DialogDefinitions.Add(“CB3ImageManager”, cb3ModalDialog);

 

And in javascript

var dialogOpener = editor.get_dialogOpener();

dialogOpener.open('CB3ImageManager', args);

 

Now the questions are

1.      Is this is proper way to create custom dialogs? Mainly these dialogs loads faster that the way shown here http://demos.telerik.com/aspnet-ajax/editor/examples/customdialogs/defaultcs.aspx

2.     How to make localization JavaScript object available on this ascx dialog so that I can design multilingual custom dialog correctly. In my case  if write document.write(localization["Flip"]); it gives error.

3.      How can I make server controls like RAD Tab strips localized for custom dialogs?

4.      What is the syntax/proper method of adding new localization strings to .resx files.

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Jun 2009, 11:30 AM
Hi Frank,

The proper way to create a custom dialog is to use the solution provided in the Custom Dialogs example and to use the showExternalDialog() method. This type of custom dialogs loads a standard ASPX page for a dialog content.
The code that you use is used to open built-in dialogs and it is not recommended for custom dialog creation.

There shouldn't be any differences in the loading speed of the showDialog and in the dialogOpener.open approaches. The recommended way loads an aspx file in RadWindow. Once the dialog is loaded for the first time its content is cached and every subsequent loading should be faster. The first time is slower because the dialog is reading its javascript file and the server code in it is compiled on the server.

As to the localization question: Since you are loading a standard ASPX file via the showExternalDialog() method which has a standard codebehind file, you can implement your own custom localization as per your project requirements.

Regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Frank Witte
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or