代码如下:
<asp:ScriptManager ID="ScriptManager
" runat="server">
<Services>
<asp:ServiceReference Path="~/WebService
asmx" />
</Services>
</asp:ScriptManager>
SinaWeiBo
WebService
cunzai($(this)
val()
a
b)
{
function a(result) {
if (result == "该邮箱已存在请重新输入") {
$(
#txtusername
)
val(
);
$(
#txtusername
)
focus();
$(
#emailyz
)
text(result);
}
else { $(
#emailyz
)
text(
可以使用
); }
}
function b() {
$(
#emailyz
)
text(
没有返回值
);
}
}
webservice
代码如下:
public string cunzai(string txtusername)
{
//判断邮箱存不存在
try
{
SinaWeiBo
BLL
T_Users bt
= new BLL
T_Users();
DataSet ds = new DataSet();
ds = bt
GetList(" T_UserEmail=
" + txtusername + "
");
string cha = ds
Tables[
]
Rows[
][
]
ToString();
return "该邮箱已存在请重新输入";
}
catch {
return "正确";
}
}