I\'ve got my form as follows
@Using (Ajax.BeginForm(\"Contact\", \"Main\",
I haven't worked with the ASP.NET MVC AJAX helpers in awhile, but I believe Ajax.BeginForm
adds an inline onsubmit
handler in the generated (HTML) markup.
If this is the case, calling submit on this form programmatically (your jQuery that triggers the submit
event) will not call the onsubmit
function of the form, which most likely cancels the normal submit action and submits the form via AJAX.
For more information about why this happens, check out this related answer.
As an alternative, you can post the form via AJAX using
I've found either of these methods less of a hassle than using Microsoft's AJAX helpers.
Do you have the jquery ajax script included? I've noticed this sort of behavior when I didn't include it:
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>