I have a Kendo Dropdownlist as follow,
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")
};
}
But the dropdownlist is empty. When set break point in CountryAjax, it doesn't stop there (means that CountryAjax is never executed). BTW, this code works fine for Telerik ASP.Net MVC. What is the problem? Thanks.
You are not supplying a countryId parameter. If the method signature was public ActionResult CountryAjax() it will fire I think.