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

Server Side Save + Custom Processing

1 Answer 136 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Yurko asked on 14 Jan 2020, 06:40 PM

Im trying to SAVE the resulting image to the server. Tried following some sample code with no luck

Sever side code never fires

(Code simple passes a MEMORY STREAM object to  a function (doc.AddVersion) that will save the content into the database)


Error: Sys.ArgumentException: Cannot deserialize empty string.
Parameter name: data ScriptResource.axd:50457:2736
Protected Sub RadImgEdt_ImageSaving(sender As Object, args As Telerik.Web.UI.ImageEditorSavingEventArgs)
       Dim doc As Object = tableDocumentGeneric.getDocument()
       Dim img As Telerik.Web.UI.ImageEditor.EditableImage = args.Image
       Dim ms As New IO.MemoryStream
       args.Cancel = True
   End Sub


<telerik:RadImageEditor ID="RadImageEditor1" runat="server"
    Style="top: 0px; left: 0px;" Width="100%" Height="100%">
    <EditableImageSettings MaxJsonLength="2147483640" />
            <telerik:ImageEditorTool CommandName="Print"/>
            <telerik:ImageEditorTool CommandName="Save" />
            <telerik:ImageEditorTool CommandName="Crop" />
            <telerik:ImageEditorTool CommandName="Zoom" />
            <telerik:ImageEditorToolStrip Text="Undo" CommandName="Undo" />
            <telerik:ImageEditorToolStrip Text="Redo" CommandName="Redo" />
            <telerik:ImageEditorTool Text="Rotate Right" CommandName="RotateRight" />
            <telerik:ImageEditorTool Text="Rotate Left" CommandName="RotateLeft" />
            <telerik:ImageEditorTool Text="Reset" CommandName="Reset" />
    (function (global, undefined) {
        Telerik.Web.UI.ImageEditor.CommandList["Print"] = function (imgEditor, commandName, args) {
    function printIT() {

        //redirect to show PDF version of item

    function OnClientImageLoad(imageEditor, args) {
        imgEditor = imageEditor;
        imgEditor.set_height(document.body.scrollHeight - 50);
    function OnClientCommandExecuting(imageEditor, eventArgs) {
        if (eventArgs.get_commandName() == 'Save') {
            imageEditor.saveImageOnServer('', true);
            //Prevent the buil-in Save dialog to pop up
            imageEditor.setToggleState('Save', false);
            imageEditor.saveImageOnServer('', true);

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 15 Jan 2020, 01:12 PM

Hi Yurko,

I tested the provided setup and the ImageSaving event was fired successfully at my end. Can you confirm that there are no JavaScript error thrown on the page when Save button is clicked?

For convenience, I am attaching my test page to this reply so you can test it at your end, I am using the latest version of the controls.

Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question