PUT for Edit View and DELETE for delete view

Apr 12, 2011 at 5:00 AM

Edit View, Edit Action, Delete View and Delete Action is genereated as Http POST in CRUD Controller option.

But, IMHO, Edit View and Action are better as Http PUT,


        //
        // PUT: /People/Edit/5

        [HttpPut]
        public ActionResult Edit(Person person)
        {

@using (Html.BeginForm()) {
    @Html.HttpMethodOverride(HttpVerbs.Put)
    @Html.ValidationSummary(true)

Delete View and Action are better as Http DELETE.


        //
        // DELETE: /People/Delete/5

        [HttpDelete]
        public ActionResult Delete(int id)
        {
        ...


@using (Html.BeginForm()) {
    @Html.HttpMethodOverride(HttpVerbs.Delete)