$(function(A) { $(String.format("#{0}", _loginButtonId)).bind("click", submitLogin) }); function submitLogin(E) { var D = $(String.format("#{0}", _userNameTextBoxId)).val().trim(); var B = $(String.format("#{0}", _passwordTextBoxId)).val().trim(); if ($(String.format("#{0}", _userNameTextBoxId)).next().size() > 0) { $(String.format("#{0}", _userNameTextBoxId)).next().remove() } if ($(String.format("#{0}", _passwordTextBoxId)).next().size() > 0) { $(String.format("#{0}", _passwordTextBoxId)).next().remove() } if (D == "") { var A = $("<span>必填！</span>").insertAfter($(String.format("#{0}", _userNameTextBoxId))).css({ color: "#ff0000" }); setTimeout(function(F) { A.remove() }, 5000); E.preventDefault(); return false } if (B == "") { var A = $("<span>必填！</span>").insertAfter($(String.format("#{0}", _passwordTextBoxId))).css({ color: "#ff0000" }); setTimeout(function(F) { A.remove() }, 5000); E.preventDefault(); return false } var C = $(String.format("#{0}", _rememberCheckBoxId)).val(); $(this).attr("disabled", true); $("#loading").fadeIn(); EnjooSite.Web.WebServices.AsynLogin.Login(D, B, C, _isHostAdmin, callback_Success, callback_Error, { sender: $(this), loadingBox: $("#loading") }) } function callback_Success(result, userContext, methodName) { result = eval("(" + result + ")"); if (result.type == "success") { window.location = result.commandArgument } $("#alertBox").html(result.message).css({ color: "#f00" }); userContext.sender.attr("disabled", false); userContext.loadingBox.fadeOut() } function callback_Error(B, C, A) { alert(B.get_message()); C.loadingBox.fadeOut() } if (typeof (Sys) !== "undefined") { Sys.Application.notifyScriptLoaded() };