<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ajax webserver</title>
<script type="text/javascript">
function GetLogin()
{
var parme = document.getElementById("txtAccount").value;
test.login.loginService.GetLogin(parme,Complate,Error);
}
function Complate(result)
{
var message = "";
if(result ==false)
{
message = "<font color='blue'>此账号可以注册!</font>";
}
if(result == true)
{
message = "<font color='red'>此账号已经存在!</font>";
document.getElementById("submit").disabled = true;
}
document.getElementById("SpShowMessage").innerHTML = message;
//alert(result);
}
function Error(result)
{
alert(result);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/login/loginService.asmx" />
</Services>
</asp:ScriptManager>
<div>
用户名: <input id="txtAccount" type="text" onkeyup="GetLogin();"/><span id="SpShowMessage"></span>
<p>
<input type="button" id="submit" runat="server" value="提交"/>
</p>
</div>
</form>
</body>
</html>