如何在myasp.net mvc应用程序中完成Ajax.actionlink调用后显示弹出消息

How to display a popup message after completing the Ajax.actionlink call in myasp.net mvc application

本文关键字:调用 actionlink Ajax 显示 消息 myasp net mvc 应用程序      更新时间:2023-09-26

我有以下ajax.actionlink:-

@Ajax.ActionLink("Delete", "Delete", "Answer",
        new { id = answer.AnswersID },
          new AjaxOptions
          {
              Confirm = "Are You sure You want to delete this Answer ?",
              HttpMethod = "Post",
              UpdateTargetId = @answer.AnswersID.ToString(),
              OnSuccess = "removePartial2",
          })

当前,如果调用成功,它将调用removePartial2 java脚本,,,但在成功完成"删除成功"的调用后,我如何显示确认消息

您可以在removePartial2函数中执行此操作:

function removePartial2(result) {
    alert('Deletion was successful');
}