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

How to get file url from ImageManager, FlashManager,DocumentManager,MediaManager?

3 Answers 68 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Anh Tú
Top achievements
Rank 2
Anh Tú asked on 22 Mar 2011, 03:39 AM
How to get file url from ImageManager, FlashManager,DocumentManager,MediaManager?

I use "OnClientCommandExecuting" event to get file url when click Insert.
Imgscript += "<script type=\"text/javascript\">";
                Imgscript += "function changeImageManager(editor, args) {";
                Imgscript += "if (args.get_commandName() == \"ImageManager\" || args.get_commandName() == \"InsertImage\"  ) {";
                Imgscript += "var callbackFunction = function (sender, args) {";
                Imgscript += "var result = args.get_value();";
                Imgscript += "$('#" + owtxt.ClientID + "').val(result.src);";
                Imgscript += "result = Telerik.Web.UI.Editor.Utils.getOuterHtml(result);";
                Imgscript += "editor.pasteHtml(result, \"ImageManager\");";
                Imgscript += "};";
                Imgscript += "args.set_callbackFunction(callbackFunction);";
                Imgscript += "}";
 So:
use: "result.src" to get Image Url. from imageManager/insertImage
What about FlashManager,DocumentManager,MediaManager?
Please tell me how to get file url?
result.movie or result.src or result.embed or another?
----
Thanks and Best regards.

3 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 24 Mar 2011, 11:05 AM
Hi Anh Tú,

You can see in this forum how to obtain the src of the inserted flash object: FlashManager returning src. The solution is similar for the media manager. You can see how to obtain the href of the document manager in this KB: Using the Image and Document managers outside RadEditor.

All the best,
Rumen
the Telerik team
0
Felipe Casanova
Top achievements
Rank 1
answered on 21 Aug 2013, 11:10 AM
Hi Rumen, 

I have the same problem as Anh Tú and your solution works fine if the FlashManager (or MediaManager) are being used as standalone. What about if they are being used from the RadEditor?

Thanks!
0
Ianko
Telerik team
answered on 26 Aug 2013, 07:19 AM
Hello,

Currently the RadEditor's content is modified by its built-in dialogs and the values are not available after the item insertion by design.

You could create a customized built-in dialog and further implement the insertion function of the desired manager to pass the values to the needed variables.

The user control files needed for this customization can be found in the folder [RadControls_InstallationFolder]/EditorDialogs.

Regards,
Ianko
Telerik
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 the blog feed now.
Tags
Editor
Asked by
Anh Tú
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Felipe Casanova
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or