在选择另一个下拉列表后,我正在尝试填充kendo下拉列表 . 这是我的视图的代码:

function ItemTypeList(e) {
    var itemType = $("#txtItemTypeName").data("kendoDropDownList").text();
    var brandName = $("#txtBrandName").data("kendoDropDownList").text();


    $.ajax({
        url: "/Accountability/GetSpecificationList",
        data: { 'items': itemType + '|' + brandName  },
        datatype: "json",
        type: "GET",
        success: function (data) {
            $('#txtSpecification').data('kendoDropDownList').dataSource.data(data);
        },
        error: function () {

        }
    });
}

这是我的控制器的代码:

public string GetSpecificationList(string items)
    {
        string sql = "";
        var obj = items.Split('|');

        sql = @"select specification from AIMS.mItem 
                 where ItemTypeID=(select ItemTypeID from AIMS.mItemType where ItemTypeName='" + obj[0] + @"') 
                 and BrandID=(select BrandID from AIMS.mBrand where BrandName='"+ obj[1]+@"')
                 order by Specification";

        DataTable dt = function.ExecuteQuery(sql);
        string data = dt.Rows[0]["specification"].ToString();
        return data;
    }

这是我的下拉列表代码:@(Html.Kendo() . DropDownListFor(m => m.xSpecificationList).Name(“txtSpecification”) . DataValueField(“specification”) . DataTextField(“specification”) . HtmlAttributes(new {@style =“width:100%”}) . BundTo((System.Collections.IEnumerable)@ ViewBag.xSpecificationList).Filter(“contains”) . OptionLabel(“ - Select - ”)

我没有收到任何错误,但是下拉列表中显示的结果是'undefined' image

有人能帮我吗?我被这个困扰了 .