AutoComplete and Web API - getting object with information

2 posts, 0 answers
  1. Jakub
    Jakub avatar
    5 posts
    Member since:
    Apr 2014

    Posted 29 Apr 2014 Link to this post


    I am using JavaScript implementation of AutoComplete that is wired directly onto Web API. I need to get the typed content of the textbox in the Web API. Is that any easy way how to serialize the object that is being passed from the JavaScript (probably OData object) to some class in C# in Web API? The object seems to contain filtering, paging etc.

    I know that this is designed to be used with MVC but I need to make it work somehow with Web API.

    Thank you,

  2. Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 01 May 2014 Link to this post

    Hello Jakub,

    I would suggest you check our ServerFiltering demo, which shows how to bind to a OData service. The datasource is configured to use an "odata" type. Thus on filtering the datasource will send the filter information to the server in correct format (you can examine the payload of the requests made by the widget). Another option is to use the parameterMap option to translate the filter information to any format your service recognizes. 

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top