Validate Indian mobile no In Asp.net Webform...
Now i am going to discuss about how to validate a Indian Mobile Number.It should not accept any Aplhabets , or any special characters for this you have to write RegularExpression Validator to Accept only Numbers
EX:
Regex: \d+
the RegularExpressionValidator to validate the phone number without using JavaScript. So something like this:
<asp:regularexpressionvalidator id="RegularExpressionValidator1">
ControlToValidate="TextBox1"
ValidationExpression="\d+"
Display="Static"
EnableClientScript="true"
ErrorMessage="Please enter numbers only"
runat="server"/>
Atlast i have to check whether user entered Number is 10 digit or not and also it should be valid Mobile Number
Regex : ^[9][0-9]{9}$
This Regex which first digit should be 9 then followed by 9 digits and totally it accept only 10 digits.
This Regex which first digit should be 9 then followed by 9 digits and totally it accept only 10 digits.
So something like this:
<asp:regularexpressionvalidator id="RegularExpressionValidator1">
ControlToValidate="TextBox1"
ValidationExpression="^[9][0-9]{9}$"
Display="Static"
EnableClientScript="true"
ErrorMessage="Please enter numbers only"
runat="server"/>
The Certified Authorization Professional (CAP) certification identifies enterprise system owners and security officers who authorize and maintain information systems, with a focus on balancing risk with security requirements and countermeasures. The CAP credential is aimed at the private and public sectors, including U.S. federal government agencies such as the State Department and the Department of Defense (DoD). Achieving the certification helps DoD personnel comply with the 8570 Mandate.
ReplyDelete