-1
I am making a login screen in ASP.NET MVC. The framework does all the complete processes without errors: goes to the database, queries the login and comes back with an OK (user exists, I can authenticate). When the flow comes back from the bank and goes through if (dados.OK)
, he has to throw me to another page, but this is not happening: simply the browser runs the code and does not throw me to the other page (_ViewStart
)
What could it be? A better way? Tips?
$(document).ready(function () {
$("#status").hide();
$("#btLogar").click(function () {
$.ajax({
data: { Login: $("#txtLogin").val(), Senha: $("#txtSenha").val() },
dataType: "json",
type: "GET",
url: "/Login/AutenticarLogin",
async: true,
beforeSend: function () {
$("#status").html("Estamos autenticando o usuário... Só um instante.");
$("#status").show();
},
success: function (dados) {
if (dados.OK) {
$("#status").html(dados.Mensagem)
setTimeout(function () { window.location.href = "_ViewStart" }, 5000);
alert("logado");
$("#status").show();
}
else {
$("#status").html(dados.Mensagem);
$("#status").show();
}
},
error: function () {
$("#status").html(dados.Mensagem);
$("#status").show()
}
});
});
Start by seeing and posting the btLog button,
– Marco Souza
I don’t understand....
– Daniel Vasconcelos