TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Validating a mobile number using ASP.NET
Naveen Kumar
Apr 14
2015
Code
1.2
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
< label > my mobile phone number
is
< /label>
<span>
<asp:TextBox ID=
"txtMobile"
runat=
"server"
CssClass=
"textbox"
MaxLength=
"10"
></asp: TextBox > < /span>
<asp:RequiredFieldValidator ID=
"RequiredFieldValidator3"
ValidationGroup=
"signup"
runat=
"server"
ErrorMessage=
"Please Enter Mobile Number"
ControlToValidate=
"txtMobile"
Display=
"None"
>
</asp: RequiredFieldValidator >
< asp: RegularExpressionValidator ID =
"RegularExpressionValidator2"
ValidationGroup =
"signup"
runat =
"server"
ErrorMessage =
"Mobile No Should Be in 10 Digits and a valid mobile number"
ControlToValidate =
"txtMobile"
Display =
"None"
ValidationExpression =
"^[789]\d{9}$"
>
< /asp:RegularExpressionValidator>
Mobile Validation
Validation a mobile number