Basit Khan

Basit Khan

  • NA
  • 336
  • 121.2k

How to check the Login in Ajax

Jul 12 2015 12:28 AM
I have table Called Mst_User for Login Checkup. The Column are Us_No, Us_Name, Us_Password and Us_Admin.

I have created OData Services. Now i want to check the login User name & password.

OData Services work perfectly. I checked through explore.

Below is the code, Please tell me how to check this in ajax.

var _url = "http://localhost:58890/DataService.svc/Mst_User?$filter=Us_Name eq '" + LoginPage.currentUser.UserName() + "' and Us_Password eq'" + LoginPage.currentUser.Password() + "'&$format=json";
$.ajax({
type: "GET",
url: _url,
timeout: 10000,
async: true,
dataType: "json",
contentType: "application/jsonp; charset=utf-8",
success: function (data) {
//How to check here if Us_Admin=1 then Navigate
//Else
//Show error
}
});

Thanks
Basit



Answers (1)