Validate Mobile Number With 10 Digits In ASP.NET

I have a text box for mobile number,number which should be only of 10 digits. Here is the code for validating textbox for 10 digit mobile number.

.ASPX File
  1. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br\>  
  2. <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"  
  3. ControlToValidate="TextBox1" ErrorMessage="RegularExpressionValidator"  
  4. ValidationExpression="[0-9]{10}"></asp:RegularExpressionValidator>  
Using this you can simply validate a TextBox Control in ASP.Net
Ebook Download
View all
Learn
View all