Good morning, I am trying to use a form
I understand that the problem is presented in the "Add" button of the popup, it makes a submit of the form, which is inside an Ajax.BeginForm.
If the main page has another form defined this can cause problems, remember that there can be no nested form tags, you should remove the form from the main page.
Although I would recommend that you evaluate sending the popup data using ajax but using the $ .ajax of jquery and not by means of the Ajax.BeginForm ()
Sending JSON to an ASP.NET MVC Action Method Argument
This way you control the call and there is no submit of a form
Verify that the JS jquery.unobtrusive-ajax.js
is not being duplicated, since you are calling the JS at the beginning and in the script section when calling the bundle jqueryval
; to avoid the submit you can make the AJAX request with $.ajax
of jQuery.
Good luck.
You can use:
$("#submit").on('submit', function(event){
event.preventDefault();
[Ajax de envio de datos al controlador]
return false;
});
With the event.preventDefault()
you avoid the send function of the submit, and you can send all the data by an AJAX to the controller.
This avoids postback and you can render what you want in the same view that you already have open.