The Jquery.ajax () method of executing a WCF service http://www.cnblogs.com/insus/p/3727875.html we have practice in an ASP. NET MVC application, the POST data goes to WCF Service and execute the method.
The exercise in this article is to commit a more complex object to the WCF service execution method. In the previous article, it passed only two parameters. If we develop in the usual, need to pass too many parameters, that need to write a number of parameters. Therefore, this article is generated, and more parameters are created as an object. Then just pass this object to the WCF service.
Below, under the ASP. NET MVC directory structure models, create an object that supports WCF service:
In the interface of the WCF service, create two methods, one to pass in the primary health value, to get a single record ienumerable<insus.net.models.fruitkind> Getbyprimarykey (byte FRUITKIND_NBR). The other is the Update data void update (Insus.NET.Models.Kind k):
Here are the two methods to implement:
Next, we want to add a column to this example in the "ASP. NET MVC method for calling WCF service" http://www.cnblogs.com/insus/p/3720547.html:
The results of the operation are shown below:
Go to the controller and add a View action (action):
This allows the user to click on the "Details" link, which will jump to this view. Displays this record and allows users to make changes and updates:
Tags 1 and 2 are HTML markup as well as reference qjery and custom JS libraries.
Tag 3 Load data:
Tag 4, which dynamically generates a record of each field. :
Tag 5, get the parameters on the address bar:
Flag 6, Update the Ammonium button event:
Real-time Operation Demo: