cascading combobox work with ASMX

2 posts, 0 answers
  1. Gary
    Gary avatar
    1 posts
    Member since:
    May 2012

    Posted 28 May 2013 Link to this post

    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!
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 29 May 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top