Ajax and WebService implement mailbox authentication (no refresh Verify email address is legitimate) _ajax related

Source: Internet
Author: User
First add a service reference to the project
---------------------------Verify that the Email address is correct. aspx-----------------
Copy Code code as follows:

<title></title>
<body>
<form id= "Form1" runat= "Server" >
<asp:scriptmanager id= "ScriptManager1" runat= "Server" >
</asp:ScriptManager>
<asp:updatepanel id= "UpdatePanel1" runat= "Server" >
<ContentTemplate>
<div>
Email<asp:textbox id= "Txtemail" runat= "Server" ></asp:textbox><asp:label id= "Lblinfo"
runat= "Server" text= "></asp:Label>
<br/>
<br/>
<asp:button id= "Button1" runat= "Server" text= "Call onclick=" Button1_Click "/>"
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>

--------------------Verify that the Email address is correct. Aspx.cs-----------------------
Copy Code code as follows:

protected void Button1_Click (object sender, EventArgs e)
{
Webemail.validateemailwebservice webemail = new Webemail.validateemailwebservice ();
byte result = Webemail. Validateemailaddress (Txtemail. Text);
if (result = = 0)
{
Lblinfo. Text = "Please verify again";
}
else if (result = = 1)
{
Lblinfo. Text = "email address valid";
}
else if (result = = 2)
{
Lblinfo. Text = "Only the domain name is correct";
}
else if (result = = 3)
{
Lblinfo. Text = "An unknown error";
}
else if (result = = 4)
{
Lblinfo. Text = "Mail server not found";
}
else if (result = = 5)
{
Lblinfo. Text = "e-mail address error";
}
else if (result = = 6)
{
Lblinfo. Text = "Free user authentication exceeds quantity (50 times/24 hours)";
}
else if (result = = 7)
{
Lblinfo. Text = "Business User cannot pass validation";
}
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.