Prasad Bhagat

Prasad Bhagat

  • NA
  • 516
  • 234.8k

Page url getting the data after lgoin function success?

Apr 7 2016 7:55 AM
Dear All,
 
am Implementing  a login page using asp.net ajax  with ajax jquery call .witih web method,am passing USERNAME AND PASSWORD  and getting response as userdata .if the userdata!=null then i would like to redirect the page from login to welcome .but if username password are success then also data was displaying in URL.and not redirecting to any page .
 
 
am using asp.net ,ajax jquery .
the login function like bellow
 
 
function Login() {
debugger
var txtuserid = $("#txtuserid").val();
var txtpassword = $("#txtpassword").val();
$.ajax({
type: "POST",
url: "Index.aspx/AuthenticateUsers",
data: "{'UserId' : " + JSON.stringify(txtuserid) + ",'Password' : " + JSON.stringify(txtpassword) + "}",
contentType: "application/json; charset=utf-8",
datatype: "jsondata",
async: "false",
success: function (ResultSet) {
debugger
if (ResultSet != null) {
sessionStorage.setItem("UserName", txtuserid);
window.location = "Reports.aspx";
}
},
error: function (Response) {
alert(Response.d.ResultStatus.StatusInd + " " + Response.d.ResultStatus.StatusMsg);
}
});
}
 
please help me to how to redirect these page to welcome page .. 

Answers (1)