Binding Data from WCF Service

4 posts, 0 answers
  1. Karl
    Karl avatar
    3 posts
    Member since:
    Jun 2012

    Posted 01 Jun 2012 Link to this post

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

  2. King Wilder
    King Wilder avatar
    240 posts
    Member since:
    Oct 2007

    Posted 20 Aug 2012 Link to this post

    Try HttpGet on your controller action.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Karl
    Karl avatar
    3 posts
    Member since:
    Jun 2012

    Posted 21 Aug 2012 Link to this post

    Sorry that wasn't the case.

    After hundreds of views and no reply's we got it working.
  5. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 05 Dec 2012 Link to this post

    I have the same problem where the spinner just spins and no data is shown, have did you manage to fix it?
Back to Top
UI for ASP.NET MVC is VS 2017 Ready