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

cascading combobox work with ASMX

1 Answer 70 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 28 May 2013, 06:58 AM
hi, 

because our team still relies on the traditional web service (ASMX) to get data. can anyone kindly advise how to integrate the cascading combo with ASMX service?

my code doesn't seem to work, found many 'undefined' in the dropdown list. 
View
 
var categories = $("#cmbWidgetCat1").kendoComboBox({
        dataTextField: "Display",
        dataValueField: "Value",
        dataSource: {
            type: "json",
            transport: {
                read: wsPath + "/GetTabItems"
            }
        }
    }).data("kendoComboBox");
 
ASMX
 
[WebMethod(EnableSession = true)]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
        public WidgetComboItem[] GetTabItems()
        {
            return new List<WidgetComboItem>
                {
                    new WidgetComboItem {Display = "System Info", Value = "1"},
                    new WidgetComboItem {Display = "Datasets", Value = "2"},
                    new WidgetComboItem {Display = "Charts", Value = "3"},
                }.ToArray();
        }


Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 29 May 2013, 04:17 PM
Hello,

 Your transport requires additional configuration in order to work with ASMX web services:

           transport: {
                read: {
                   url: wsPath + "/GetTabItems",
                   dataType: "json",
                   contentType: "application/json; charset=utf-8",
                }
            }

More info about requesting ASMX services with jQuery (used by the Kendo DataSource) is available in the linked blog post.

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