Skip to content

Instantly share code, notes, and snippets.

@ZhenDeng
Last active January 20, 2019 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZhenDeng/bac5c812692a679b9d7e969597d07c7f to your computer and use it in GitHub Desktop.
Save ZhenDeng/bac5c812692a679b9d7e969597d07c7f to your computer and use it in GitHub Desktop.
$.ajax({
url: '/Account/Login',
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify(loginInfo),
dataType: 'json',
success: function (output) {
if (output.Status == 'fail') {
hideProgress();
$('#btnLogin').hideProgress();
$('#btnLogin').showValidator(output.Message, 'error', msgPosition, true);
$('#btnLogin').html(loginText);
}
else {
$('#btnLogin').html('Authenticated');
if (window.location.search.substr(0, 11) == '?ReturnUrl=') {
window.location = decodeURIComponent(window.location.search.slice(11));
}
else
window.location.reload();
}
},
error: function (request, status, error) {
hideProgress();
$('#btnLogin').hideProgress();
$('#btnLogin').html(loginText);
$('#btnLogin').showValidator(error, 'error', msgPosition, true);
}
});
$.ajax({
type: "GET",
url: 'api/Checkout/GetPartnerByMPNId?mpnId=' + mpnId,
async: false,
success: function (data) {
if (data.result != 'Success') {
$('#tenant_next').showValidator(data.info, 'error');
isValid = false;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment