jquery+asp教程.net 检测账号是否已被注册的实例代码
<%@ page language="c#" autoeventwireup="true" codebehind="default.aspx.cs" inherits="ajax_xml._default" %>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml" >
<head runat="server">
<title></title>
<script type="text/网页特效" src="jquery-1.3.2-vsdoc2.网页特效" language="网页特效"></script>
<script type="text/javascript" language="javascript">
$(function() {
$("#<%=userid.clientid%>").keyup(
function() {
$.ajax({
type: "post",
contenttype: "application/网页特效on",
datatype: "json",
url: "webservice1.asmx/userisexist",
data: "{userid:'" + $("#<%=userid.clientid%>").val() + "'}",
success: function(result) {
if (result.d == "true")
$("#<%=isexist.clientid%>").text("yes"); //账号已存在
else
$("#<%=isexist.clientid%>").text("no");
}
});
}
);
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:textbox id="userid" runat="server"></asp:textbox>
<asp:label id="isexist" runat="server" visible="true"></asp:label>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
首页 1 2 末页