Does anyone know what I need to get the ajax.beginform
to work in my MVC4 project? I updated the jQuery library to version 2 and I have included the jquery.validate.js
and jquery.validate.unobtrusive.js
but the form is still posting to the new page rather than just updating the UpdateTargetId
element
I have had a google and a lot of people seem to be having problems with a script called Microsoft.jQuery.Unobtrusive.Ajax
but this isn't in my project. Do I need to install this, and if so do I then need to do a find and replace on live
so that it uses on
instead?
This is the form code:
@using (Ajax.BeginForm("AddImage", "Quote", FormMethod.Post, new AjaxOptions { UpdateTargetId = "Files" }, new { enctype = "multipart/form-data" }))
{
}
This posts to the quote controller addimage action and all that does is write out a string to the screen (which should appear in the Files
div) but instead of doing an ajax call it is actually going to the Quote/AddImage page