The following assistant can be added to the form:
<%= Html.HttpMethodOverride(HttpVerbs.Delete) %>
This will include a hidden field that will instruct the framework to trigger the correct action of the controller. Now there are two possibilities:
- Normal html form submit: only POST is supported, therefore it will be used, but due to the hidden field the correct action of the controller will be called.
- AJAX: you can use any desired verb, including DELETE, to serialize the input values โโof the form and submit them - there is no problem.
source
share