This is a migrated thread and some comments may be shown as answers.

Binding Data from WCF Service

3 Answers 255 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 01 Jun 2012, 09:45 PM
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:

@(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;
}

3 Answers, 1 is accepted

Sort by
0
King Wilder
Top achievements
Rank 2
answered on 20 Aug 2012, 11:47 PM
Try HttpGet on your controller action.
0
Karl
Top achievements
Rank 1
answered on 21 Aug 2012, 01:49 PM
Sorry that wasn't the case.

After hundreds of views and no reply's we got it working.
0
madladuk
Top achievements
Rank 2
answered on 05 Dec 2012, 12:02 PM
I have the same problem where the spinner just spins and no data is shown, have did you manage to fix it?
Tags
DropDownList
Asked by
Karl
Top achievements
Rank 1
Answers by
King Wilder
Top achievements
Rank 2
Karl
Top achievements
Rank 1
madladuk
Top achievements
Rank 2
Share this question
or