为什么Kendo Dropdownlist最初无法读取数据

时间:2015-01-22 00:46:02

标签: kendo-ui kendo-dropdown

我有一个Kendo Dropdownlist如下,

Html.Kendo().DropDownList()
    .Name("CountryName")
    .HtmlAttributes(new { style = "font-size:8pt;width:110px" })
    .DataValueField("Id")
    .DataTextField("Description")
    .DataSource(source =>
        {
            source.Read(read =>
            {
                read.Action("CountryAjax", "Shared");
            });
        })

Where

[HttpPost]
public ActionResult CountryAjax(string countryId)
{
    var countries = this._decodeBL.GetAllCountriesList();

    return new JsonResult
    {
        Data = new SelectList(countries, "Id", "Description", "Canada")
    };
}

但是下拉列表是空的。在CountryAjax中设置断点时,它不会停在那里(意味着从不执行CountryAjax)。顺便说一下,这段代码适用于Telerik ASP.Net MVC。问题是什么?感谢。

1 个答案:

答案 0 :(得分:1)

您没有提供countryId参数。如果方法签名是公共的ActionResult CountryAjax(),我认为它会解雇。