I am trying to switch to MVC action using POSTing, not GETting. (The action is DELETE, and I do not want it to be accessible via an external link.)
I am using the link in the grid generated
Ajax.ActionLink("Remove", "Delete", new { saID = Model.Said, id = e.id }, new AjaxOptions { HttpMethod = "POST", Confirm = "Are you sure you want to delete this item?" })
What generates the following HTML:
<a href="/Equipment/Delete/102424/229933" onclick="Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, confirm: 'Are you sure you want to delete this item?', httpMethod: 'POST' });">Remove</a>
My problem is that when I click on the link, I achieve the βDeleteβ action with GET, not POST, and the confirmation dialog is not executed. I searched for it several times for several hours and continued to wind around its axis. What am I doing wrong?
ajax model-view-controller actionlink
Dave hanna
source share