MVC 3 Ajax.ActionLink with JQuery UI Confirm Dialog

前端 未结 6 1417
攒了一身酷
攒了一身酷 2020-12-29 15:55

I have a @Ajax.ActionLink which calls a Delete Action. Now I want to use JQuery UI Dialog confirm instead the regular \"Confirm\" attribute of the Ajax link. I hook the eve

6条回答
  •  误落风尘
    2020-12-29 16:39

    You migth use the OnBegin property instead OnSuccess, this is just a simple example but it could help you, this is how I declare my Ajax.ActionLink link:

    @Ajax.ActionLink("Delete", "DeletePeriod", "ConfigPeriod", 
    new { area = "Budget", id = Model.Id }, new AjaxOptions
    {
        HttpMethod = "Post",
        OnBegin = "confirmDeletion"
    })
    

    And this could be a really simple implementation of the confirmDeletion function:

    
    

    Regards.

提交回复
热议问题