1
Answer

Conformation Dialog box on ajax.actionlink in mvc

Photo of Nikhil Ladva

Nikhil Ladva

8y
2.2k
1
Conformation Dialog box on ajax.actionlink in mvc

Answers (1)

0
Photo of Brijesh Rathor
NA 374 685 8y
Use the OnBegin event:
@Ajax.ActionLink("Done", "ActionName",
new AjaxOptions
{
OnBegin = "return ConfirmDone()",
UpdateTargetId = "MyContainerId"
})
You could also use the Confirm ajax option if all you need to do is pop up a confirm box. If you need to do more custom logic (or want to use a custom dialog) then you would need to use OnBegin.
Here is an example of using Confirm:
@Ajax.ActionLink("Done", "ActionName",
new AjaxOptions
{
Confirm= "Are you sure you want to do this?",
UpdateTargetId = "MyContainerId"
})
 
Hope this will help u.