I have code of Jquery login control loke following using this into asp.net but but confused where and how I can simply authenticate username and password.
Logi
Here's how you can write an ajax call to start with
var usernameText = $("#usernameTextbox");
var passwordText = $("#passwordTextbox");
$.ajax({
type: 'GET',
url: '/Account/ValidateUser',
async: true,
dataType: 'json',
data:
{
userName: usernameText,
password: passwordText
},
success: function(result) {
if(result){
// redirect user to required page
}
else{
// show error on some div that usrname and password do not match
}
}
});
Related Question on SO
MVC 4 Jquery Ajax call returns login page html
How to use Basic Auth with jQuery and AJAX?