This is a continuation from my question last night. I have a JQuery AJAX response, as below. I just need this to redirect to another view. See my code:
$.ajax({
url: "/Home/PersistSelections",
type: 'post',
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: JSON.stringify(selectedItems),
done: function (response) {
window.location.href = "Home/GoToBooking";
}
})
The code in done, does not seem to work. I have also tried success. I'm also not sure what the parameter should be (response, or something else?).
In addition, I have seen code like this:
return JavaScript("window.location = 'http://www.google.co.uk'");'
I have JavascriptResult
resolving in my controllers, but when I try to use return Javascript
, I can't seem to resolve the references? I am using ASP.NET Core 2.2.