Note that there are some explanatory texts on larger screens.

plurals
  1. POWebAPI Model Binding from JSON
    text
    copied!<p>I am creating an application using Durandal, with WebAPI as the server. I have a KendoUI grid that displays the data from the server correctly and functions properly until the POST or PUT methods are called. Here is my GET method: <img src="https://i.stack.imgur.com/vRKg2.png" alt="enter image description here"></p> <p>and you can see that that data binds to the UI (used the <a href="http://durandaljs.com/documentation/KendoUI/" rel="noreferrer">data-bind extensibility</a> in Durandal to change to kendo bindings): <img src="https://i.stack.imgur.com/BpV9p.png" alt="enter image description here"></p> <p>Then I edit the data in the Grid and it passes the changes inside the request to the server as you can see in this Fiddler result: <img src="https://i.stack.imgur.com/YTVum.png" alt="enter image description here"></p> <p>On the server side I cannot get the data that is passed from the client to bind to anything I place as a parameter for the method on the POST or PUT. <img src="https://i.stack.imgur.com/zb6MD.png" alt="enter image description here"></p> <p>I realize this is a couple different technologies to troubleshoot (e.g. Durandal, KnockoutJs, Kendo DataBinding, and WebAPI) but I think the fundamentals are working, the data is retrieved and bound to the UI and it is posted back when changed, but the WebAPI endpoint cannot bind to the data.</p> <p>How can I get the passed "models" array to bind through the ModelBinding structure in WebAPI?</p> <p>UPDATE- Here is the helpful JSFiddle that gave me the correct Content-Type to add: <a href="http://jsfiddle.net/Xhrrj/1/" rel="noreferrer">http://jsfiddle.net/Xhrrj/1/</a></p> <p><code>new kendo.data.DataSource({ transport: { read: { type: "POST", url: "../cccs/service.svc/SupplierSearch", contentType: "application/json; charset=utf-8", dataType: 'json'...</code></p> <p>this is coming from the Telerik forum <a href="http://www.kendoui.com/forums/framework/data-source/problem-with-datasource-post-request-for-read-operation.aspx" rel="noreferrer">here</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload