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

How to call a WebMethod in KendoUI Editor Web

1 Answer 77 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Santosh
Top achievements
Rank 1
Santosh asked on 30 Jul 2015, 08:39 AM

Hi,

I am trying to implement ImageBrowser feature of editor of KendoUI web but not able to make a webmethod call. Since I found sample code for MVC implementation and taken reference  of the same but unfortunately not working for me. Below is my code.

HTML:

 <textarea id="editor" rows="10" cols="15" style="height:200px">Test</textarea>

 

JS:

  $(document).ready(function () {
            $("#editor").kendoEditor({
                imageBrowser: {
                    transport: {
                        read: {
                            type: "POST",
                            contentType: "application/json; charset=utf-8",
                            url: "ManageNotes.aspx/Read",
                            dataType: "json"
                        },
                        //destroy: {
                        //    url: "http://localhost/editor/service/ImageBrowser/Destroy",
                        //    type: "POST",
                        //    dataType: "json",
                        //    contentType: "application/json"
                        //},
                        create: {
                            url: "ManageNotes.aspx/Create",
                            type: "POST",
                            dataType: "json",
                            contentType: "application/json"
                        },
                        //thumbnailUrl: "http://localhost/editor/service/ImageBrowser/Thumbnail",
                        uploadUrl: {
                            url: "ManageNotes.aspx/Upload",
                            //data: "{'type':''}",
                            type: "POST",
                            dataType: "json",
                            contentType: "application/json"
                        },
                        imageUrl: "ManageNotes.aspx/Image?path={0}"
                    }
                }
            });
        });

CS:

  [WebMethod]
       // [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
        public static void Read(string path)
        {
          
        }

Attaching same sample code...  Is there anything I'm missing?

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 03 Aug 2015, 08:28 AM
Hello Santosh,

I am afraid that we do not have an example of WebMethods server-side solution for the Editor's ImageBrowser, as we do not  support for that technology out of the box. I would however, recommend checking the this article, which might be of use.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Editor
Asked by
Santosh
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or