Web API deletes file records in JSON format, apijson

Source: Internet
Author: User

Web API deletes file records in JSON format, apijson

Insus. NET series of Web Api learning articles, this is the last article in the plan, delete file records in JSON format. I learned how to update data in the previous article "PUT function demo in Web APIs" http://www.cnblogs.com/insus/p/437982.html. Data is involved in program development. To facilitate user management, the query, add, update, and delete functions are generally provided. This document deletes the data in the file.

The following is a detailed demonstration of Insus. NET. A type of Web Api: "DELETE ".
Add a public void Delee (Order order) method to API control, which indicates the core code section, that is, deleting the Item in List <Order>. The parameter uses model to facilitate a record to be a multi-primary key or an external key value. You are not sure about the number of parameters. Therefore, model is used for processing.



For other code, refer to the previous "PUT function demo in Web Api" at http://www.cnblogs.com/insus/p/437982.html.

Create an html webpage and write static code:



When loading data, the data row is dynamically generated. It obtains all the data of the file and displays it on the webpage:



Now we can write the Delete button event, because it is generated dynamically in the data line, I have to use the jQuery delegate implementation.



After completing the calculation, I have worked hard before and learned here, which has become simple and familiar. Finally, we will demonstrate the Code implemented above:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.