Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function loginHandler() {
- var username = $("#login_UserName").val();
- var password = $("#login_Password").val();
- var isPersistent = $("#login_RememberMe").attr("checked");
- var customInfo = null;
- var redirectUrl = null;
- // Log them in.
- alert("try login");
- ssa.login(username,
- password,
- isPersistent,
- customInfo,
- redirectUrl,
- onLoginComplete,
- onError);
- alert("made it here");
- }
- function(c, b, a, h, f, d, e, g) {
- this._invoke(this._get_path(), "Login", false, { userName: c, password: b, createPersistentCookie: a }, Function.createDelegate(this, this._onLoginComplete), Function.createDelegate(this, this._onLoginFailed), [c, b, a, h, f, d, e, g]);
- }
- function loginHandler() {
- var username = $("#login_UserName").val();
- var password = $("#login_Password").val();
- var isPersistent = $("#login_RememberMe").attr("checked");
- var customInfo = null;
- var redirectUrl = null;
- // Log them in.
- alert("try login");
- $.ajax( {
- url : '<%= Url.Action( "Login", "Account" ) %>',
- type: 'post',
- dataType: 'json',
- data: { username: username,
- password: password,
- isPersistent: isPersistent,
- },
- success: onLoginComplete,
- error: onError
- });
- alert("made it here"); // this will execute before the callback completes...
- }
- $('#btnLogin').click(function(e) {
- e.preventDefault();
- var username = $("#txtUserName").val();
- var password = $("#txtPassword").val();
- var isPersistent = $("#ckRememberMe").attr("checked");
- var customInfo = null;
- var redirectUrl = null;
- // Log them in.
- alert("try login");
- $.ajax({
- url: '<%= Url.Action( "LogOn", "Account" ) %>',
- type: 'post',
- contentType: "application/json; charset=utf-8",
- dataType: 'json',
- data: "{ 'username': '" + username + "', 'password':'" + password + "', 'isPersistent': '" + isPersistent + "'}",
- success: onLoginComplete,
- error: onError
- });
- alert("made it here");
- });
- function onLoginComplete(result) {
- alert("hooray");
- }
- function onError(result) {
- $('#loginFailed').show();
- }
Add Comment
Please, Sign In to add comment