I have this ajax in my login page, and I reference a checker.aspx that checks if the username and password is valid and returns 0 or 1. How do I return 0 or 1 in xml in my checker page ? Is it possible with AJAX ? function getResult() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("lblMessage").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "checker.aspx?username=" + document.getElementById("txtUserName").value + "&password=" + document.getElementById("txtPassword").value, true);
//xmlhttp.open("GET", "http://localhost:49745 + /logcheck.asmx?op=Auth" + "?username=" + document.getElementById("txtUserName").value + "&password=" + document.getElementById("txtPassword").value, true);
xmlhttp.send();
}
No comments:
Post a Comment