I have an ajax link for deleting items in my list.
Here is the view:
@Ajax.ActionLink("Test", "Delete", new { projectID = item.ProjectID }, new AjaxOptions
{
Confirm = "Are you sure you want to delete this item?",
HttpMethod = "DELETE",
OnSuccess = "function() { alert('ok'); }"
})
Here is the action controller:
[AcceptVerbs(HttpVerbs.Delete)]
public ContentResult Delete(int projectID)
{
Project proj = m_ProjectBusiness.GetProject(projectID);
if (proj != null)
{
m_ProjectBusiness.DeleteProject(proj);
}
return null;
}
The confirmation message is displayed.
The action controller is called.
The view is displayed back
BUT the OnSuccess event is not fired!