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

Passing Client Data via AddText Command

1 Answer 42 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Adrian asked on 01 Aug 2012, 05:38 PM
I have some custom commands that are working fine, and I am able to pass client data to the code-behind using the commandArgument. However, if I try to do the same thing for the built in AddText functionality, the popup dialog never displays.

//If this is done, the text editor dialog won't show. Not sure why.
Telerik.Web.UI.ImageEditor.CommandList.AddText = function (imageEditor, commandName, args) {
    var commandText = "AddText";
    var commandArgument = customClientSideDataHere;
    imageEditor.editImageOnServer(commandName, commandText, commandArgument, callbackFunction);

I am currently reading the custom data here:
protected void RadImageEditor1_ImageEditing(object sender, ImageEditorEditingEventArgs args)
 string text = args.Argument;

If I comment out the client-side code above, the Add Text popup works as expected. Is there something I am doing wrong, or is there another way to pass client side data to the code-behind?

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 06 Aug 2012, 11:49 AM
Hi Adrian,

The issue with the non displaying AddText's dialog is due to that the code bellow is actually overwriting all the functions of AddText command. This approach is useful when you need to declare a custom command and its functionality. If you want to customize some of the RadImageEditor's built-in commands (as it is in the case when you want to extend AddText's functions), the best way is to modify the RadImageEditor's dialog for this command.

You could find more information about the mentioned approach in this help article: Loading the Dialogs from External Files and in this code library: Registering External Dialogs of RadImageEditor.

All the best,
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.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question