- First add regular expression validator for the particular textbox.
- Now the right click on regular expression validator and set "Errormessage" propert as "Enter Valid Mobile Number",Set ControlToValidate as textboxname you want to validate and select expression property.
- Various validation will come up select any of them and according to your selection expression will be shown below.
- Delete whole expression and enter the below expression.
^[7,8,9]{1}[0-9]{9}$ (To Validate General Mobile Number)
^((\+){0,1}91(\s){0,1}(\-){0,1}(\s){0,1}){0,1}9[0-9](\s){0,1}(\-){0,1}(\s){0,1}[1-9]{1}[0-9]{7}$ (To Validate Indian Mobile Number)
Press ok and you have done it.
Great Article
ReplyDeleteASP.NET Training
Dot Net Training in Chennai
ASP NET Training
ASP.NET Online Training
Dot Net Training in Chennai
.Net Online Training
.net training online
Dot Net Online Training
C# Training
Core C# Interview Questions
Dot Net Interview Questions
Fantastic article, it clears my boubts. Thanks.
ReplyDeleteDotnet Training in chennai