AjaxBeginForm Replace does not work

1

I am using Ajax.BeginForm to update a specific div on the page. When submitting and executing the action, instead of updating this DIV, the page is updated with the partial view returned from Action. I use this same snippet of code in another project and this works normally.

I have tried to reimport the javascript libraries to the partial view but still the error persists.

Below is the code snippet for Ajax.BeginForm .

@using (Ajax.BeginForm("Bar", new AjaxOptions { 
    HttpMethod = "POST",
    InsertionMode = InsertionMode.Replace, 
    UpdateTargetId = "Foo" 
})) 
{ 
// ... 
}
    
asked by anonymous 09.10.2014 / 16:55

1 answer

2

You added the scripts: ~ / Scripts / jquery.unobtrusive-ajax.js

If you do not have it in your project, you have: link

In your Action, the return is a PartialView?

Abs,

    
09.10.2014 / 20:53