I've got a fairly common scenario, but I can't quite figure it out.
My app deals with an individual subscriber. Subscribers can have a list of contact addresses, and also, separately, a list of another property. So on the subscriber page, I have two different fieldsets, each with a list, and a "Create New" button. The Contacts are maintained by the Contacts controller, and the other property is maintained by a different controller.
The list of contacts is displayed using a standard foreach loop with a table/tr/td hierarchy. I want the capability for each contact in the list, to be able to delete it, so I have a Delete action in my ContactsController, and create an ActionLink in the rightmost cellof each row:
<%= Html.ActionLink("Delete", "Delete", "Contacts", new {id= contact.Id}, null) %>
Which works, EXCEPT that, I read once, and understand, it's NOT a good idea to have a Delete action reachable by an HTTP GET request, since any arbitrary person (or robot) can go in and delete anything they want.
I tried to implement it using an Ajax.ActionLink with an AjaxOptions object with the HttpMethod set to Delete, as described in the ASP.NET MVC Tuturial But my Delete method in Contacts is returning a RedirectToAction result back to the Subscribers/Index action. Since Ajax is trying to do a partial update, it appears to ignore the redirect to action (which reconstitutes the now-modified contact list), and appears to simply re-display the original page, including the deleted contact. So I really would like to do the equivalent of that tutorial (including the Confirmaton alert) without using Ajax. In other words, do an ActionLink, but provide some parameter to make it use at least a POST, and preferably a DELETE HTTP method. But I can't find anything that will let me do that. (BTW, I can't just return the PartialView as was done in the tutorial because the delete method is in the ContactsController, and view that I need to go back to is in the SubscribersController. PartialView will accept a view name, but not a controller name.)
I appreciate any insights. Thanks.