c# equivalent of JavaScript

  • Thread starter Thread starter Y a h y a
  • Start date Start date
Y

Y a h y a

Guest
Hi

What is the c# equivalent of below please?

Thanks

Regards


this.authenticate = function (username, password, deviceId) {
var deferred = $.Deferred();
var authModel = { grant_type: 'password', username: username, password: password, deviceid: deviceId };

$.ajax({
type: "POST",
url: url.concat(path),
data: 'grant_type=password&username=' + authModel.username + '&password=' + authModel.password,
model: authModel,
contentType: "application/x-www-form-urlencoded",
dataType: 'json',
success: function (data, status, jqXHR) {
deferred.resolve();
},
error: function (jqXHR, status) {
deferred.reject();
}
});

return deferred.promise();
};

Continue reading...
 
Back
Top