Copy codeThe Code is as follows:
<Asp: ScriptManager ID = "ScriptManager1" runat = "server">
<Services>
<Asp: ServiceReference Path = "~ /WebService1.asmx "/>
</Services>
</Asp: ScriptManager>
SinaWeiBo O. WebService1.cunzai ($ (this). val (), a, B)
{
Function a (result ){
If (result = "this email already exists, please enter it again "){
$ ('# Txtusername'). val ('');
$ ('# Txtusername'). focus ();
$ ('# Emailyz'). text (result );
}
Else {$ ('# emailyz'). text (' usable ');}
}
Function B (){
$ ('# Emailyz'). text (' no return value ');
}
}
Webservice:
Copy codeThe Code is as follows:
Public string cunzai (string txtusername)
{
// Identify whether the email address does not exist
Try
{
SinaWeiBo O. BLL. T_Users bt1 = new BLL. T_Users ();
DataSet ds = new DataSet ();
Ds = bt1.GetList ("T_UserEmail = '" + txtusername + "'");
String cha = ds. Tables [0]. Rows [0] [0]. ToString ();
Return "this email already exists. Please enter it again ";
}
Catch {
Return "correct ";
}
}