我的表单中有 ajax.actionlink:
<% using (Html.BeginForm("UpdateRecordingDetails", "Recording", FormMethod.Post, new { id = "frmRecordingEdit" }))
{%>
<%= Ajax.ActionLink("Event Notifications", "procesCallrecording", new { Id = ViewData["RecordingIDsEdit"] }, new AjaxOptions { OnSuccess = "alert('success message');" })%>
<%
}
%>
控制器动作是这样的:
public JsonResult procesCallrecording(int Id = 0 )
{
return Json("success", JsonRequestBehavior.AllowGet);
}