I have the following jQuery-code that make a POST:
$.ajax({
url: 'http://localhost:65148/Home/BandRegister',
data: formData,
type: "POST",
processData: false,
contentType: false,
success: function (data, textStatus, XMLHttpRequest) {
//location = data.url;
console.log(data);
},
error: function (data, textStatus, XMLHttpRequest) {
console.log(data);
}
});
I handle the post In the following controller:
if (BandProfile != null)
{
userManager.AddToRole(UserId, "Band");
return Json(new { url = Url.Action("Index", "Home", new { model = BandProfile }) }, JsonRequestBehavior.AllowGet);
}
In the controller, I want to redirect to a new controller and view, and pass the model with me. How can I do this with jQuery?
Or should I just get the information from the database and make a new model object when I have redirected to the new controller? Thus skip to pass the model with me?
Here Is my HTML:
Firstname: Lastname: Birth: Profile picture: Genre(loop out from table in database): Lägg till flera alternativ här. Precis som när man ska tagga någotCreate
I am capturing the input values with jquery.