I followed the sample code and when I load the application, all I get is a spinning circle in the dropdown list.
I've tried several things, but can anyone find out what's wrong with the code I'm using to get the data in the dropdown list?
Razor Code:
Controller Code:
I've tried several things, but can anyone find out what's wrong with the code I'm using to get the data in the dropdown list?
Razor Code:
@(Html.Kendo().DropDownListFor(model => model.EquipmentReturnStatusId)
.Name("_EquipmentReturnStatusId")
.DataTextField("EquipmentReturnStatusName")
.DataValueField("EquipmentReturnStatusId")
.DataSource(datasource => datasource.Read(read => read.Action("Read", "EquipmentReturnStatus")))
.OptionLabel("Take me to your Leader")
)
Controller Code:
[HttpPost]
public JsonResult Read()
{
try
{
EquipmentReturnService.EquipmentReturnServiceClient client = new EquipmentReturnService.EquipmentReturnServiceClient();
var returns = client.GetEquipmentReturnStatuses();
return Json(returns);
}
catch (Exception ex)
{
string errorMessage = "An error occurred: " + ex.Message;
}
return null;
}