How can I fill out a form without using @HTML.Beginform and by using JQuery Ajax instead? Right now I tried:
var postData = { form1: username, form2: password };
$.ajax({
type: "POST",
url: '/Controller/Method',
data: postData,
dataType: "json",
traditional: true
});
But after posting, the browser does not navigate to the correct view. Of course I have return View() correctly in controller. Using Fiddler I see that it's correctly posted and the response is correct too...
Do I have to use @HTML.Beginform or can I do it with Ajax?