代码
function OnClickLogin()
{
SetDefaultLoginCompletedCallBack();
SetDefaultLogoutCompletedCallBack();
SetDefaultFailedCallBack();
Sys.Services.AuthenticationService.login(username.value,
password.value, false,null,null,null,null,"User Context");
}
function OnClickLogout()
{
Sys.Services.AuthenticationService.logout(null,
null, null, null);
}
function OnFailed(error,
userContext, methodName)
{
DisplayInformation("error:message = " +
error.get_message());
DisplayInformation("error:timedOut = " +
error.get_timedOut());
DisplayInformation("error:statusCode = " +
error.get_statusCode());
}
function OnLoginCompleted(validCredentials,
userContext, methodName)
{
password.value = "";
if (validCredentials == true)
{
username.value = "";
buttonLogin.style.visibility = "hidden";
usernameEntry.style.visibility = "hidden";
passwordEntry.style.visibility = "hidden";
textNotLoggedIn.style.visibility = "hidden";
buttonLogout.style.visibility = "visible";
textLoggedIn.style.visibility = "visible";
DisplayInformation("");
}
else
{
textLoggedIn.style.visibility = "hidden";
textNotLoggedIn.style.visibility = "visible";
DisplayInformation(
"Login Credentials Invalid. Could not login");
}
}
function OnLogoutCompleted(result)
{
usernameEntry.style.visibility = "visible";
passwordEntry.style.visibility = "visible";
textNotLoggedIn.style.visibility = "visible";
buttonLogin.style.visibility = "visible";
buttonLogout.style.visibility = "hidden";
textLoggedIn.style.visibility = "hidden";
}
function DisplayInformation(text)
{
//…………(省略:负责在页面下方提示行是显示相应信息)
}
if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- Ajax技术专题 (556篇文章)
- Java编程开发手册 (8291篇文章)
- .NET移动与嵌入式技术 (5963篇文章)
- .NET开发手册 (5664篇文章)
- Ajax技术应用开发 (556篇文章)
- ASP.NET教程 (8457篇文章)
- .NET实用开发 (1683篇文章)
- .NET框架架构 (467篇文章)
- JAVA和.Net开发 (106篇文章)
- AJAX应用实践 (116篇文章)
- AJAX应用之注册用户即时检测 (14次浏览)
- AJAX应用之草稿自动保存 (7次浏览)
- 为ASP.NET MVC框架添加AJAX支持 (4次浏览)
- AJAX通用类:AJAXRequest v0.3 (3次浏览)
- AJAX开发简略 (3次浏览)
- ajax的缺点 (3次浏览)
- ajax代理程序自动判断字符编码 (3次浏览)
- AJAX打造博客无刷新搜索 (2次浏览)
- 不用组件实现Ajax效果 (0次浏览)
- XMLHttpRequest对象如何铸就AJAX辉煌 (0次浏览)



