I'm trying to update a form in my application using Ajax.BeginForm.
The updation is taking place but after executing the function in the controller it redirects to a view with the controller function name. I don't want it to redirect to another view instead I want to display an alert message like success or failure.
@using (Ajax.BeginForm("Insert", "User", new AjaxOptions{
HttpMethod = "POST",
UpdateTargetId = "target",
OnSuccess = "success"
}))
{
@foreach (var item2 in Model.sample)
{
@item2.name
}
Save
}