Call the MVC deletion method, which is labeled "Httpdelete"
Ajax invocation, type is "delete"
In native debugging, the error 404 method could not be found
So the web.config modifications in the MVC Project are configured as follows:
<system.webServer>
<validation validateintegratedmodeconfiguration= "false"/>
<modules Runallmanagedmodulesforallrequests= "true" >
</modules>
</system.webServer>
Set Modules Property runallmanagedmodulesforallrequests to True
Local debug again, I see.
There are also ways to call Delete on the front end, and some people think it is:
The standard requests in jquery are only get and post, and put and delete are actually post requests, except for the parameters _method:put and Method:delete, so you can use $ when Ajax delete requests in jquery. Post (URL, {_method: "delete"}, function (data) {...}). This is much better than using $.ajax directly ({method::d elete}) for two reasons, 1: Some browsers do not support {method::d Elete} and {method::p ost}2: This AJAX request cannot process the returned data
Specifically with verification
So confident that the service deployed on the server, but 404 did not disappear, 405 appeared
So we see the following solution:
The put operation of the rest service on IIS7.5 occurs with HTTP Error 405.0-method not allowed workaround
WebDAV is a set of extensions to the Hypertext Transfer Protocol (HTTP) that provides standards for editing and file management between computers on the Internet. This protocol allows users to perform remote basic file operations via the web, such as copying, moving, deleting, and so on. In IIS 7.0, WebDAV is a stand-alone extension module that requires a separate download, while IIS 7.5 integrates WebDAV, but WebDAV Put,delete. So the RESTful service (WCF Data service,wcf Rest service,asp.net Web api,asp.net MVC) deployed on IIS 7.5 is tragic, HTTP Error occurs when a put request is sent 405.0– method is not allowed error, the workaround is simple, add the following setting in Web.config:
<system.webServer>
<modules>
<remove name= "Webdavmodule"/>
</modules>
Original address; http://www.cnblogs.com/shanyou/archive/2012/03/23/2414252.html
The service on the IIS server restarts, the method of the delete operation returns 200 and the request succeeds.