Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form submitted twice after updating from ASP MVC 3 Preview to Beta

After upgrading my ASP MVC from 3 Preview to 3 Beta I see strange behaviour in my Ajax forms.

@using(Ajax.BeginForm("New", new AjaxOptions() {OnSuccess = "onAjaxSuccess", OnFailure = "onAjaxFailure", OnBegin = "onAjaxBegin", HttpMethod = "Post"})) {}

<form action="/Order/New" data-ajax="true" data-ajax-begin="onAjaxBegin" data-ajax-failure="onAjaxFailure" data-ajax-method="Post" data-ajax-success="onAjaxSuccess" method="post"></form>

I have placed an alert inside my function onAjaxBegin and it is beeing fired twice, each time i click on my submit button.

Anyone else seen this behaviour? I have not changed anything in the code after upgrading, and it worked perfectly before the upgrade.

like image 458
Martin at Mennt Avatar asked Oct 31 '10 09:10

Martin at Mennt


1 Answers

I had the same problem, and i found the solution: I included the "jquery.unobtrusive-ajax.min.js"-Script twice :-)

like image 148
Markus Avatar answered Sep 23 '22 10:09

Markus