I have a modal window (in a view rendered from “public ActionResult ViewItems“) that when clicked; submits an empty form to an actionresult called [HttpPost]public ActionResult DeleteItems.
It then deletes all the items displayed.
I dont need to post any data, as it just deletes all, but at the same time i dont want to have this on a HttpGet method.
So, can i remove the form and still get jquery to trigger this ActionResult?
I could do it with ajax but would rather not.
Thanks,
Kohan
Its either ajax or a form. That it – your only options as per the http spec. You need a form for your post if not using ajax.
Why not take the pattern used in the MVC samples for a delete? You get a confirmation and then another post. Your post should be from a form, and that form should also have an antiforgerytoken in it.