Verify the mobile phone number in ASP. net mvc, asp. netmvc
In ASP. net mvc, you can use the RegularExpression feature to verify the mobile phone number.
public class Customer {[Required (ErrorMessage = "Required")][Displ
protected void Button1_Click (object sender, EventArgs e){if (Regex.IsMatch (TextBox1.Text.Trim (), @ "^\d{7,11}$")){String num = TextBox1.Text.Trim (). Substring (0, 7);DataRow dr = DAL.oledb.ExecuteDataRow ("Db.mdb", "SELECT * from list where num =?", num);if (dr! = null){Response.Write (TextBox1.Text.Trim () + "}}}ASP. NET implementation of mobile phone number
protected void Button1_Click (object sender, EventArgs e){if (Regex.IsMatch (TextBox1.Text.Trim (), @ "^\d{7,11}$")){String num = TextBox1.Text.Trim (). Substring (0, 7);DataRow dr = DAL.oledb.ExecuteDataRow ("Db.mdb", "SELECT * from list where num =?", num);if (dr! = null){Response.Write (TextBox1.Text.Trim () + "}}}ASP. NET implementation of mobile phone number
application can be obtained through the getPackageName () method of Activity or Context (Activity inherited from Context). However, many settings can be added, usually set to 0. Finally, the PackageManager object is obtained. The Context object provides the getPackageManager () method to obtain the object. In summary, the template code is as follows: (Note that the encapsulated method is located in an Activity, so this is used directly to replace the Context object) 1/** 2 * Get version 3 * @ r
need the following [3|4|5|8| 9][0-9] represents any number in the middle of 0-9, which can be 0 or 9\d{4,8} This \d, like [0-9], is a number in the middle of 0-9. {4,8} represents the highest 8 digits of the previous minimum 4-digit number. Why here is not the direct 8, because the cell phone
Verify that the account is validVerification rules: a combination of letters, numbers, and underscores. It must start with a letter and contain 4-16 characters.
FunctionCheckuser (STR ){VaRRe=/^ [A-Za-Z] \ W {3, 15} $/;If(Re. Test (STR) {alert ("Correct");}Else{Alert ("Error") ;}} Checkuser ("jiade_cnblogs");//Call
Verify mobile phone numberVerification rules: 11-digit number, starting with 1.
Funct
)) {
alert (' identity card number filled in error ');
return false;
}
Detailed version of ID card verification:
Http://www.jb51.net/article/88771.htm
3.js verification of mobile phone number
China's mobile phone number
This article describes the PHP implementation of the replacement of mobile phone number between the number of * and hidden IP last few methods. Share to everyone for your reference, specific as follows:
$string = "13826589549";
$pattern = "/(\d{3}) \d\d (\d{2})/";
$replacement = "\$1****\$3";
Print Preg_replace ($pattern, $replacement, $string);
Re
");//calledVerify MailboxValidation rules: Leave your email address in the "first part @ Second part"The first part: By letter, number, underline, short line "-", Dot "." CompositionPart two: For a domain name, the domain name consists of letters, numbers, short-term "-", the domain name suffix,and the domain name suffix is generally. xxx or. xxx.xx, a domain name suffix is generally 2-4-bit, such as cn,com,net
}$/; if (Re.test (str)) { alert ("correct"); } else{ alert ("Error");} } Checkphone ("09557777777");//CallVerify MailboxValidation rules: Leave your email address in the "first part @ Second part"The first part: By letter, number, underline, short line "-", Dot "." CompositionPart two: For a domain name, the domain name consists of letters, numbers, short-term "-", the domain name suffix,and the domain name suffix is generally.
1. Account numberRules: Letters, numbers, underscores, letters beginning with 4-16 digits.Expression:/^[a-za-z]\w{3,15}$/;2. Mobile phone numberRule: 11 digits, starting with 1Expression:/^1\d{10}$/3. Phone numberRules: Area code + number, area code starts with 0, 3-bit or 4-digit number consists of 7-or 8-digit number
Jquery implements the number selection method for mobile phone numbers. jquery implements mobile phone numbers
This example describes how to select a mobile phone number using jquery. Share it with you for your reference. The details are as follows:
Some time ago I saw that
rules: Leave your email address in the "first part @ Second part"The first part: By letter, number, underline, short line "-", Dot "." CompositionPart two: For a domain name, the domain name consists of letters, numbers, short-term "-", the domain name suffix,and the domain name suffix is generally. xxx or. xxx.xx, a domain name suffix is generally 2-4-bit, such as cn,com,net, now the domain name will be m
= "") {return
false;
} else {
if (!/^[0-9][0-9]{5}$/.test (postcode)) {return
false;
}
}}
return true;
}
Order Submission Page-Verify phone number
function Is_mobile (MOBILE) {
if (mobile = "") {return
false;
} else {
if (!/^0{0,1} (13[0-9]|15[0-9]|18[0-9]|14[0-9]) [0-9]{8}$/.test (MOBILE)) {return
false;
}
return true;
}
Order Submission Page-Verify the legality of the email
fun
The mobile phone sends the verification code -.net and the verification code. net.
The verification code sent by SMS is as follows:
(1) The user submits a mobile phone number and applies for the verification code of the Lake District
(2) The website generates a verification
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.