Simplifying, in my First page, I have this:
$(function () {
check();
})
function check() {
$.get("/MyController/MyAction/", function (data) {
if(data != undefined && data != "")
{
window.location.href = data;
}
})
}
this works well, but if the user comes back on the page (using browser go back button) the jquery get function doesn't reach to the controller and the data variable is blank. Why jquery get function doesn't execute my controller action? I have the same result using ajax:
$.ajax({
url: "/MyController/MyAction/",
})
.done(function (data) {
if(data != undefined && data != "")
{
window.location.href = data;
}
});