Use DELETE form method in Html.BeginForm()?

前端 未结 1 1807
不思量自难忘°
不思量自难忘° 2021-01-12 05:09

I\'d like to use the appropriate HTTP method when possible. In this case, when a button is clicked to delete something, I want to fire the controller action with the attribu

相关标签:
1条回答
  • 2021-01-12 05:36

    You need this in your form:

    @using (Html.BeginForm("Order", "Users"){ 
       @Html.HttpMethodOverride(HttpVerbs.Delete)
    }
    
    0 讨论(0)
提交回复
热议问题