Home  >  Article  >  Web Front-end  >  JQuery calls webservice to implement email verification (checking whether it is available)_jquery

JQuery calls webservice to implement email verification (checking whether it is available)_jquery

WBOY
WBOYOriginal
2016-05-16 17:33:321061browse
Copy code The code is as follows:






SinaWeiBo.WebService1.cunzai($(this).val(), a, b)
{
function a(result) {
if (result == "The email already exists, please re-enter") {
$('#txtusername').val('');
$('#txtusername').focus();
$('#mailyz').text(result);
}
else { $('#emailz').text('can be used'); }
}
function b() {
$('#emailz').text( 'No return value');
}
}

webservice:
Copy code The code is as follows:

public string cunzai(string txtusername)
{
//Determine whether the mailbox exists
try
{
SinaWeiBo.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 "The email already exists, please re-enter";
}
catch {
return "Correct";
}
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn