I would like to know if there is a specific way to submit a form using jQuery AJAX in MVC6, still using the Auto Binding features of ASP.NET MVC. I believe in other versions of MVC you could use jquery.unobtrusive-ajax and simply use
@using (Ajax.BeginForm(SaveData, new AjaxOptions(){}
Since there have been some changes with MVC6 I am wondering what the new recommended way to do this would be besides doing a normal AJAX post to the server when the form is submitted. This meaning I would manually get the values of each input field, turn them into JSON and send them over to the controller so everything will get bound to the ViewModel.
If I use the following JavaScript for AJAX do any of the AJAX form settings even matter?
$('form').submit(function () {
$.ajax({
type: POST,
url: /Products/Create/,
data: JSON.stringify(data),
contentType: application/json; charset=utf-8,
dataType: json
});
});